public class DelayedAsyncTransactionManager implements AsyncTransactionManager
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.
Implements
AsyncTransactionManagerMethods
beginAsync()
public AsyncTransactionManager.TransactionContextFuture beginAsync()
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 | |
---|---|
Type | Description |
AsyncTransactionManager.TransactionContextFuture |
close()
public void close()
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()
public ApiFuture<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 | |
---|---|
Type | Description |
ApiFuture<Void> |
getCommitResponse()
public ApiFuture<CommitResponse> getCommitResponse()
Returns the CommitResponse of this transaction.
Returns | |
---|---|
Type | Description |
ApiFuture<CommitResponse> |
getState()
public TransactionManager.TransactionState getState()
Returns the state of the transaction.
Returns | |
---|---|
Type | Description |
TransactionManager.TransactionState |
resetForRetryAsync()
public AsyncTransactionManager.TransactionContextFuture resetForRetryAsync()
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 | |
---|---|
Type | Description |
AsyncTransactionManager.TransactionContextFuture |
rollbackAsync()
public ApiFuture<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 | |
---|---|
Type | Description |
ApiFuture<Void> |