public interface Transaction
Transaction
succeed or fail as a unit. Transactions can be committed and
rolled back synchronously and asynchronously.Modifier and Type | Method and Description |
---|---|
void |
commit()
Commits the transaction.
|
java.util.concurrent.Future<java.lang.Void> |
commitAsync()
An asynchronous implementation of
commit() . |
java.lang.String |
getApp() |
java.lang.String |
getId() |
boolean |
isActive() |
void |
rollback()
Rolls back the transaction.
|
java.util.concurrent.Future<java.lang.Void> |
rollbackAsync()
An asynchronous implementation of
rollback() . |
void commit()
IllegalStateException
.java.lang.IllegalStateException
- If the transaction has already been committed, rolled back, a
commit or a rollback is in progress (via an async call), or an attempt to commit or roll
back has already failed. If there are any outstanding async datastore calls when this
method is invoked, this method will block on the completion of those calls before
proceeding. If any of those outstanding calls fails, the exception from the first failing
call will be thrown.DatastoreFailureException
- If a datastore error occurs.java.util.ConcurrentModificationException
- If some other transaction modified the same entity
groups concurrently.java.util.concurrent.Future<java.lang.Void> commitAsync()
commit()
.commit()
void rollback()
IllegalStateException
.java.lang.IllegalStateException
- If the transaction has already been committed, rolled back, a
commit or a rollback is in progress (via an async call), or an attempt to commit or roll
back has already failed. If there are any outstanding async datastore calls when this
method is invoked, this method will block on the completion of those calls before
proceeding.DatastoreFailureException
- If a datastore error occurs.java.util.concurrent.Future<java.lang.Void> rollbackAsync()
rollback()
.rollback()
java.lang.String getId()
Transaction
.java.lang.String getApp()
Transaction
.boolean isActive()
true
if the transaction is active, false
otherwise.