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.


Constructor Summary
TransactionManager()
           
 
Method Summary
static TransactionHandle begin()
           
static TransactionHandle begin(int i)
           
static void commit()
          Commit a transaction
static void commit(TransactionHandle handle)
          Commit a transaction.
static com.ibm.commerce.server.UserTransaction getTransaction()
          Gets a transaction object.
static void markForRollback()
          Mark a transaction for rollback
static void rollback()
          Rollback a transaction
static void rollback(TransactionHandle handle)
          Rollback a transaction.
static boolean transactionHasRolledback()
          Returns true if the transaction has rolled back.
static boolean transactionHasRolledback(TransactionHandle handle)
          Returns 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
 

Constructor Detail

TransactionManager

public TransactionManager()
Method Detail

begin

public static TransactionHandle begin()
                               throws ECSystemException

begin

public static TransactionHandle begin(int i)
                               throws ECSystemException

commit

public static void commit()
                   throws ECSystemException,
                          javax.transaction.RollbackException
Commit a transaction

commit

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

Parameters:
handle - TransactionHandle
Throws:
ECSystemException -  

getTransaction

public static com.ibm.commerce.server.UserTransaction getTransaction()
                                                              throws java.lang.Exception
Gets a transaction object.

markForRollback

public static void markForRollback()
Mark a transaction for rollback

rollback

public static void rollback()
Rollback a transaction

rollback

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

transactionHasRolledback

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

transactionHasRolledback

public static boolean transactionHasRolledback(TransactionHandle handle)
Returns 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.