- All Implemented Interfaces:
- Enclosing class:
public static enum TransactionOptions.TransactionType extends Enum<TransactionOptions.TransactionType>
The type of transaction. With the type you have influence on how much guarantee you get when a member crashes when a transaction is committing.
Nested Class Summary
Enum Constant Summary
Enum Constants Enum Constant DescriptionThe one phase transaction executes a transaction using a single step at the end; committing the changes.The two phase commit is separated in 2 parts.
Modifier and Type Method Description
String name)(Returns the enum constant of this type with the specified name.
()Returns an array containing the constants of this enum type, in the order they are declared.
Methods inherited from class java.lang.Enum
clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Enum Constant Details
ONE_PHASEpublic static final TransactionOptions.TransactionType ONE_PHASEThe one phase transaction executes a transaction using a single step at the end; committing the changes. There is no prepare of the transactions, so conflicts are not detected. If there is a conflict, then when the transaction commits the changes, some of the changes are written and others are not; leaving the system in a potentially permanent inconsistent state.
TWO_PHASEpublic static final TransactionOptions.TransactionType TWO_PHASEThe two phase commit is separated in 2 parts. First it tries to execute the prepare; if there are any conflicts, the prepare will fail. Once the prepare has succeeded, the commit (writing the changes) can be executed. Hazelcast also provides three phase transaction by automatically copying the backlog to another member so that in case of failure during a commit, another member can continue the commit from backup. For more information see the
valuespublic static TransactionOptions.TransactionType values()Returns an array containing the constants of this enum type, in the order they are declared.
- an array containing the constants of this enum type, in the order they are declared
valueOfReturns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
idpublic int id()
getByIdpublic static TransactionOptions.TransactionType getById(int id)