Package com.google.cloud.spanner
Interface AsyncTransactionManager.CommitTimestampFuture
- Enclosing interface:
- AsyncTransactionManager
ApiFuture that returns the commit Timestamp of a Cloud Spanner transaction that
is executed using an AsyncTransactionManager. This future is returned by the call to
AsyncTransactionManager.AsyncTransactionStep.commitAsync() of the last step in the transaction.-
Method Summary
Methods inherited from interface com.google.api.core.ApiFuture
addListenerMethods inherited from interface java.util.concurrent.Future
cancel, isCancelled, isDone
-
Method Details
-
get
Returns the commit timestamp of the transaction. Getting this value should always be done in order to ensure that the transaction succeeded. If any of the steps in the transaction fails with an uncaught exception, this method will automatically stop the transaction at that point and the exception will be returned as the cause of theExecutionExceptionthat is thrown by this method.- Specified by:
getin interfaceFuture<Timestamp>- Throws:
AbortedException- if the transaction was aborted by Cloud Spanner and needs to be retried.InterruptedExceptionExecutionException
-
get
Timestamp get(long timeout, TimeUnit unit) throws AbortedException, InterruptedException, ExecutionException, TimeoutException Same asget(), but will throw aTimeoutExceptionif the transaction does not finish within the timeout.- Specified by:
getin interfaceFuture<Timestamp>- Throws:
AbortedExceptionInterruptedExceptionExecutionExceptionTimeoutException
-