com.ibm.commerce.server

Class TransactionManager

  • java.lang.Object
    • com.ibm.commerce.server.TransactionManager


  • public class TransactionManager
    extends java.lang.Object
    This class provides transaction management functions. Transactions are maintained on a per thread basis.
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String COPYRIGHT
      IBM copyright notice field.
    • Field Detail

      • COPYRIGHT

        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
        This method begins a transaction with a default time-out value. The current default value is set to 1200 seconds. This can be configured by changing the transaction time-out in the transaction service of the WebSphere Commerce Administration Console.
        Returns:
        Transaction handle
        Throws:
        ECSystemException
      • isTransactionActive

        public static boolean isTransactionActive()
                                           throws ECSystemException
        This method determines whether the transaction is active.
        Returns:
        This method returns true if transaction is active and false otherwise.
        Throws:
        ECSystemException
      • begin

        public static TransactionHandle begin(int i)
                                       throws ECSystemException
        This method begins a transaction with a given timeout value.
        Parameters:
        i - The timeout value in seconds. If the time-out value is zero or less, the default value is used.
        Returns:
        Transaction handle
        Throws:
        ECSystemException
      • commit

        public static void commit()
                           throws ECSystemException,
                                  javax.transaction.RollbackException
        This method commits a transaction.
        Throws:
        ECSystemException
        javax.transaction.RollbackException
      • commit

        public static void commit(TransactionHandle handle)
                           throws ECSystemException,
                                  javax.transaction.RollbackException
        This method commits a transaction. The transaction will only be committed if the handle indicates that it is the transaction owner.
        Parameters:
        handle - A TransactionHandle object.
        Throws:
        ECSystemException
        javax.transaction.RollbackException
      • getTransaction

        public static javax.transaction.UserTransaction getTransaction()
                                                                throws java.lang.Exception
        This method gets a transaction object.
        Returns:
        UserTransaction object
        Throws:
        java.lang.Exception
      • markForRollback

        public static void markForRollback()
        This method marks a transaction for rollback.
      • rollback

        public static void rollback()
        This method rolls back a transaction.
      • rollback

        public static void rollback(TransactionHandle handle)
        This method rolls back a transaction. This only happens if the handle indicates that the caller is the transaction owner. Otherwise, just mark the current transaction as rollback.
        Parameters:
        handle - A TransactionHandle object.
      • transactionHasRolledback

        public static boolean transactionHasRolledback()
        This method determines whether the transaction has rolled back. A transaction that is marked for rollback will be rolled back before return.
        Returns:
        This method returns true if the transaction has rolled back and false otherwise.
      • transactionHasRolledback

        public static boolean transactionHasRolledback(TransactionHandle handle)
        This method determines whether the transaction has rolled back. This check will only be made if the caller is the owner of the transaction. Otherwise it will return false.
        Parameters:
        handle - The transaction handle.
        Returns:
        This method returns true if the transaction has rolled back and false otherwise.