Class TransactionOptions.Builder (2.0.0)

public static final class TransactionOptions.Builder

Contains static creation methods for TransactionOptions.

Inheritance

java.lang.Object > TransactionOptions.Builder

Static Methods

allowMultipleEntityGroups(boolean enable) (deprecated)

public static TransactionOptions allowMultipleEntityGroups(boolean enable)

Deprecated. Use Builder.withDefaults().setXG(enable) instead.

See #withXG.

Parameter
Name Description
enable boolean
Returns
Type Description
TransactionOptions

withDefaults()

public static TransactionOptions withDefaults()

Helper method for creating a TransactionOptions instance with default values. The defaults is false (disabled) for XG.

Returns
Type Description
TransactionOptions

withPreviousTransaction(Transaction previousTransaction)

public static TransactionOptions withPreviousTransaction(Transaction previousTransaction)

Shorthand for TransactionOptions.withTransactionMode(Mode.READ_WRITE).setPreviousTransaction(...);

Parameter
Name Description
previousTransaction Transaction
Returns
Type Description
TransactionOptions

withTransactionMode(TransactionOptions.Mode mode)

public static TransactionOptions withTransactionMode(TransactionOptions.Mode mode)

Shorthand for TransactionOptions.withDefaults().setTransactionMode(...);

Parameter
Name Description
mode TransactionOptions.Mode
Returns
Type Description
TransactionOptions

withXG(boolean enable)

public static TransactionOptions withXG(boolean enable)

Create a TransactionOptions that enables or disables the use of cross-group transactions. Shorthand for TransactionOptions.withDefaults().setXG(...);

Parameter
Name Description
enable boolean

true to allow cross-group transactions, false to restrict transactions to a single entity group.

Returns
Type Description
TransactionOptions

this (for chaining)