public enum TransactionState extends Enum<TransactionState>
The transaction state is used to indicate the phase within which the transaction is currently running.
| Enum Constant and Description |
|---|
ACTIVE
Active transaction state.
|
COMMITTED
Committed transaction state.
|
COMMITTING
Committing transaction state.
|
PREPARED
Prepared transaction state.
|
PREPARING
Preparing transaction state.
|
ROLLED_BACK
Rolled back transaction state.
|
ROLLING_BACK
Rolling back transaction state.
|
| Modifier and Type | Method and Description |
|---|---|
static TransactionState |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static TransactionState[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final TransactionState ACTIVE
The ACTIVE state represents a transaction in progress. Active transactions may or may not affect
concurrently running transactions depending on the transaction's isolation level.
public static final TransactionState PREPARING
Once a transaction commitment begins, it enters the PREPARING phase of the two-phase commit protocol.
public static final TransactionState PREPARED
Once the first phase of the two-phase commit protocol is complete, the transaction's state is set to
PREPARED.
public static final TransactionState COMMITTING
The COMMITTING state represents a transaction within the second phase of the two-phase commit
protocol.
public static final TransactionState COMMITTED
Once the second phase of the two-phase commit protocol is complete, the transaction's state is set to
COMMITTED.
public static final TransactionState ROLLING_BACK
In the event of a two-phase lock failure, when the transaction is rolled back it will enter the
ROLLING_BACK state while the rollback is in progress.
public static final TransactionState ROLLED_BACK
Once a transaction has been rolled back, it will enter the ROLLED_BACK state.
public static TransactionState[] values()
for (TransactionState c : TransactionState.values()) System.out.println(c);
public static TransactionState valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullCopyright © 2013–2018. All rights reserved.