Class DelayedAsyncTransactionManager (6.89.0)

publicclassDelayedAsyncTransactionManagerimplementsAsyncTransactionManager

Represents a AsyncTransactionManager using a multiplexed session that is not yet ready. The execution will be delayed until the multiplexed session has been created and is ready. This class is only used during the startup of the client and the multiplexed session has not yet been created.

Inheritance

java.lang.Object > DelayedAsyncTransactionManager

Methods

beginAsync()

publicAsyncTransactionManager.TransactionContextFuturebeginAsync()

Creates a new read write transaction. This must be called before doing any other operation and can only be called once. To create a new transaction for subsequent retries, see #resetForRetryAsync().

Returns
TypeDescription
AsyncTransactionManager.TransactionContextFuture

close()

publicvoidclose()

Closes the manager. If there is an active transaction, it will be rolled back. Underlying session will be released back to the session pool.

closeAsync()

publicApiFuture<Void>closeAsync()

Closes the transaction manager. If there is an active transaction, it will be rolled back. The underlying session will be released back to the session pool. The returned ApiFuture is done when the transaction (if any) has been rolled back.

Returns
TypeDescription
ApiFuture<Void>

getCommitResponse()

publicApiFuture<CommitResponse>getCommitResponse()

Returns the CommitResponse of this transaction.

Returns
TypeDescription
ApiFuture<CommitResponse>

getState()

publicTransactionManager.TransactionStategetState()

Returns the state of the transaction.

Returns
TypeDescription
TransactionManager.TransactionState

resetForRetryAsync()

publicAsyncTransactionManager.TransactionContextFutureresetForRetryAsync()

Creates a new transaction for retry. This should only be called if the previous transaction failed with ABORTED. In all other cases, this will throw an IllegalStateException. Users should backoff before calling this method. Backoff delay is specified by SpannerException#getRetryDelayInMillis() on the SpannerException throw by the previous commit call.

Returns
TypeDescription
AsyncTransactionManager.TransactionContextFuture

rollbackAsync()

publicApiFuture<Void>rollbackAsync()

Rolls back the currently active transaction. In most cases there should be no need to call this explicitly since #close() would automatically roll back any active transaction.

Returns
TypeDescription
ApiFuture<Void>