i3.dragos.core.services.transactions
Enum Transaction.State

java.lang.Object
  extended by java.lang.Enum<Transaction.State>
      extended by i3.dragos.core.services.transactions.Transaction.State
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Transaction.State>
Enclosing interface:
Transaction

public static enum Transaction.State
extends java.lang.Enum<Transaction.State>

Specifies the different state transactions can be in. It is used for both user transactions and DataSourceTransactions.

Author:
Ernest Hammerschmidt <ernest@i3.informatik.rwth-aachen.de>, Thorsten Hermes <thermes@i3.informatik.rwth-aachen.de>

Enum Constant Summary
BEGUN
          A transaction has begun and commands can be issued.
COMMITTED
          A transaction is committed to the database.
CREATED
          A user transaction has started, but has not yet been begun, meaning it is not associated with any database transactions yet.
PRECOMMIT
          A nested transaction is finished, but not all parent transactions have been committed yet, meaning the changes are not yet finally written to the database.
PREPARED
          A transaction has been prepared for commit, but is not yet committed as part of the two-phase commit protocol.
ROLLBACK_ONLY
          A transaction that once has entered this state is prevented from ever committing, and can only be aborted.
ROLLED_BACK
          A transaction was rolled back, meaning all changes were discarded.
 
Method Summary
static Transaction.State valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static Transaction.State[] 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

CREATED

public static final Transaction.State CREATED
A user transaction has started, but has not yet been begun, meaning it is not associated with any database transactions yet.


BEGUN

public static final Transaction.State BEGUN
A transaction has begun and commands can be issued. This must not mean the transaction itself is active, a nested transaction might be the current one.

See Also:
TransactionManager.requestTransaction()

PRECOMMIT

public static final Transaction.State PRECOMMIT
A nested transaction is finished, but not all parent transactions have been committed yet, meaning the changes are not yet finally written to the database. From this state, there can still be a rollback, or a switch to ROLLBACK_ONLY.


PREPARED

public static final Transaction.State PREPARED
A transaction has been prepared for commit, but is not yet committed as part of the two-phase commit protocol. This state can only occur in DataSourceTransactions.


COMMITTED

public static final Transaction.State COMMITTED
A transaction is committed to the database. In this state, it is no longer tracked by the TransactionManager.


ROLLBACK_ONLY

public static final Transaction.State ROLLBACK_ONLY
A transaction that once has entered this state is prevented from ever committing, and can only be aborted.


ROLLED_BACK

public static final Transaction.State ROLLED_BACK
A transaction was rolled back, meaning all changes were discarded. In this state, it is no longer tracked by the TransactionManager.

Method Detail

values

public static Transaction.State[] 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 (Transaction.State c : Transaction.State.values())
    System.out.println(c);

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

valueOf

public static Transaction.State valueOf(java.lang.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:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null


Copyright © 2002-2008 RWTH Aachen, Department of Computer Science 3 (Software Engineering). All Rights Reserved.