com.ibm.commerce.server
Class TransactionManager

java.lang.Object
  |
  +--com.ibm.commerce.server.TransactionManager

public class TransactionManager
extends java.lang.Object

Provides transaction management fucntions. Transactions are maintained on a per thread basis.


Field Summary
static java.lang.String COPYRIGHT
          IBM copyright notice field.
 
Constructor Summary
TransactionManager()
           
 
Method Summary
static  TransactionHandle begin()
          Begins a transaction with a default timeout value.
static  TransactionHandle begin(int i)
          Begins a transaction with a given timeout value.
static void commit()
          Commits a transaction.
static void commit( TransactionHandle handle)
          Commits a transaction.
static UserTransaction getTransaction()
          Gets a transaction object.
static void markForRollback()
          Marks a transaction for rollback.
static void rollback()
          Rollbacks a transaction.
static void rollback( TransactionHandle handle)
          Rollbacks a transaction.
static boolean transactionHasRolledback()
          Checks if the transaction has rolled back.
static boolean transactionHasRolledback( TransactionHandle handle)
          Checks true if the transaction has rolled back.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail
public static final java.lang.String COPYRIGHT
IBM copyright notice field.
See Also:
Constant Field Values
Constructor Detail

TransactionManager

public TransactionManager()
Method Detail

begin

public static TransactionHandle begin()
                               throws ECSystemException
Begins a transaction with a default timeout value. The current default values is set to EC_DEFAULT_TRANSACTION_TIMEOUT which is 1200 seconds.
Throws:
ECSystemException

begin

public static TransactionHandle begin(int i)
                               throws ECSystemException
Begins a transaction with a given timeout value.
Parameters:
i - timeout value in seconds
Throws:
ECSystemException

commit

public static void commit()
                   throws ECSystemException,
                          javax.transaction.RollbackException
Commits a transaction.
Throws:
ECSystemException
RollbackException

commit

public static void commit(TransactionHandle handle)
                   throws ECSystemException,
                          javax.transaction.RollbackException
Commits a transaction. The transaction will only be commited only if the handle indicates that it is the transaction owner.
Parameters:
handle - the TransactionHandle
Throws:
ECSystemException
RollbackException

getTransaction

public static UserTransaction getTransaction()
                                      throws java.lang.Exception
Gets a transaction object.
Throws:
java.lang.Exception

markForRollback

public static void markForRollback()
Marks a transaction for rollback.

rollback

public static void rollback()
Rollbacks a transaction.

rollback

public static void rollback(TransactionHandle handle)
Rollbacks a transaction. This only happens is the handle indicates that the caller is the transaction owner.

transactionHasRolledback

public static boolean transactionHasRolledback()
Checks if the transaction has rolled back. A transaction that is marked for rollback will be rolled back before return.
Returns:
true if the transaction has rolled back; false otherwise

transactionHasRolledback

public static boolean transactionHasRolledback(TransactionHandle handle)
Checks true if the transaction has rolled back. The check will only be made is caller is the owner of the transaction, otherwise, it will return false.
Parameters:
handle - transaction handle