Interface AsyncTransactionManager.CommitTimestampFuture (6.68.0)

public static interface AsyncTransactionManager.CommitTimestampFuture extends ApiFuture<Timestamp>

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 AsyncTransactionStep#commitAsync() of the last step in the transaction.

Implements

com.google.api.core.ApiFuture<com.google.cloud.Timestamp>

Methods

get()

public abstract Timestamp 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 the ExecutionException that is thrown by this method.

Returns
Type Description
com.google.cloud.Timestamp
Exceptions
Type Description
AbortedException

if the transaction was aborted by Cloud Spanner and needs to be retried.

InterruptedException

if the transaction was aborted by Cloud Spanner and needs to be retried.

ExecutionException

if the transaction was aborted by Cloud Spanner and needs to be retried.

get(long timeout, TimeUnit unit)

public abstract Timestamp get(long timeout, TimeUnit unit)

Same as #get(), but will throw a TimeoutException if the transaction does not finish within the timeout.

Parameters
Name Description
timeout long
unit TimeUnit
Returns
Type Description
com.google.cloud.Timestamp
Exceptions
Type Description
AbortedException
InterruptedException
ExecutionException
TimeoutException