com.hazelcast.transaction

## Enum TransactionOptions.TransactionType

- java.lang.Object
- - java.lang.Enum<TransactionOptions.TransactionType>
  - - com.hazelcast.transaction.TransactionOptions.TransactionType

- All Implemented Interfaces:
    Serializable, Comparable<TransactionOptions.TransactionType>
  Enclosing class:
    TransactionOptions

      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.

- - ### Enum Constant Summary

    Enum Constants
    Enum Constant and Description
    `LOCAL` Deprecated. since 3.6 use ONE_PHASE
    `ONE_PHASE` The one phase transaction executes a transaction using a single step at the end; committing the changes.
    `TWO_PHASE` The two phase commit is separated in 2 parts.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static TransactionOptions.TransactionType` | `getByValue(int value)`
    `int` | `id()`
    `static TransactionOptions.TransactionType` | `valueOf(String name)` Returns the enum constant of this type with the specified name.
    `static TransactionOptions.TransactionType[]` | `values()` 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, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Enum Constant Detail

    - #### TWO_PHASE

          public static final TransactionOptions.TransactionType TWO_PHASE

      The 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 `TransactionOptions.setDurability(int)`

    - #### LOCAL

          @Deprecated
          public static final TransactionOptions.TransactionType LOCAL

      Deprecated. since 3.6 use ONE_PHASE

    - #### ONE_PHASE

          public static final TransactionOptions.TransactionType ONE_PHASE

      The 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.

  - ### Method Detail

    - #### values

          public static TransactionOptions.TransactionType[] values()

      Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

          for (TransactionOptions.TransactionType c : TransactionOptions.TransactionType.values())
              System.out.println(c);

      Returns:
        an array containing the constants of this enum type, in the order they are declared

    - #### valueOf

          public static TransactionOptions.TransactionType valueOf(String name)

      Returns 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.)
      Parameters:
        `name` - the name of the enum constant to be returned.
      Returns:
        the enum constant with the specified name
      Throws:
        `IllegalArgumentException` - if this enum type has no constant with the specified name
        `NullPointerException` - if the argument is null

    - #### id

          public int id()

    - #### getByValue

          public static TransactionOptions.TransactionType getByValue(int value)

Copyright © 2020. All rights reserved.