public final class TransactionOptions
extends java.lang.Object
Notes on usage:
The recommended way to instantiate a TransactionsOptions
object is to statically import
TransactionOptions.Builder
.* and invoke a static creation method followed by an instance mutator (if
needed):
import static com.google.appengine.api.datastore.TransactionOptions.Builder.*; ... datastoreService.beginTransaction(withXG(true));
Modifier and Type | Class and Description |
---|---|
static class |
TransactionOptions.Builder
Contains static creation methods for
TransactionOptions . |
static class |
TransactionOptions.Mode
The mode of the transaction.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Boolean |
allowsMultipleEntityGroups()
Deprecated.
|
TransactionOptions |
clearMultipleEntityGroups()
Deprecated.
|
TransactionOptions |
clearXG()
Return the cross-group transaction setting to default (disabled).
|
boolean |
equals(java.lang.Object o) |
int |
hashCode() |
boolean |
isXG() |
TransactionOptions |
multipleEntityGroups(boolean enable)
Deprecated.
|
Transaction |
previousTransaction()
Return the previous transaction that is being retried, or
null if none was provided. |
TransactionOptions |
setPreviousTransaction(Transaction previousTransaction)
Set which previous transaction to retry.
|
TransactionOptions |
setTransactionMode(TransactionOptions.Mode mode)
Set the mode of the transaction.
|
TransactionOptions |
setXG(boolean enable)
Enable or disable the use of cross-group transactions.
|
java.lang.String |
toString() |
TransactionOptions.Mode |
transactionMode()
Return the mode of the transaction, or
null if none was specified. |
public TransactionOptions setXG(boolean enable)
enable
- true to cross-group transactions, false to restrict transactions to a single
entity group.this
(for chaining)public TransactionOptions clearXG()
public boolean isXG()
true
if cross-group transactions are allowed, false
if they are not
allowed.public TransactionOptions setPreviousTransaction(Transaction previousTransaction)
TransactionOptions
, with
the exception of the previousTransaction
property.
A rollback is not required, and should not be performed, prior to retrying the transaction.
previousTransaction
- the transaction to retry.public Transaction previousTransaction()
null
if none was provided.public TransactionOptions setTransactionMode(TransactionOptions.Mode mode)
Specifying the mode of the transaction can help to improve throughput, as it provides additional information about the intent (or lack of intent, in the case of read only transaction) to perform a write as part of the transaction.
public TransactionOptions.Mode transactionMode()
null
if none was specified.@Deprecated public TransactionOptions multipleEntityGroups(boolean enable)
setXG(boolean)
@Deprecated public TransactionOptions clearMultipleEntityGroups()
clearXG()
@Deprecated public java.lang.Boolean allowsMultipleEntityGroups()
isXG()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object