Class TransactionImpl

  • All Implemented Interfaces:
    Transaction

    public class TransactionImpl
    extends Object
    implements Transaction
    Basic local transaction with support for multiple resources.
    • Method Detail

      • getStatus

        public int getStatus()
        Description copied from interface: javax.transaction.Transaction
        Obtain the status of the transaction associated with the target Transaction object.
        Specified by:
        getStatus in interface Transaction
        Returns:
        The transaction status. If no transaction is associated with the target object, this method returns the Status.NoTransaction value.
      • getRollbackOnly

        public boolean getRollbackOnly()
      • getTransactionKey

        public Object getTransactionKey()
      • getTransactionStatus

        public int getTransactionStatus()
      • putResource

        public void putResource​(Object key,
                                Object value)
      • registerInterposedSynchronization

        public void registerInterposedSynchronization​(Synchronization synchronization)
      • setRollbackOnly

        public void setRollbackOnly​(Throwable reason)
      • registerSynchronization

        public void registerSynchronization​(Synchronization synch)
                                     throws IllegalStateException,
                                            RollbackException,
                                            SystemException
        Description copied from interface: javax.transaction.Transaction
        Register a synchronization object for the transaction currently associated with the target object. The transction manager invokes the beforeCompletion method prior to starting the two-phase transaction commit process. After the transaction is completed, the transaction manager invokes the afterCompletion method.
        Specified by:
        registerSynchronization in interface Transaction
        Parameters:
        synch - The Synchronization object for the transaction associated with the target object.
        Throws:
        IllegalStateException - Thrown if the transaction in the target object is in the prepared state or the transaction is inactive.
        RollbackException - Thrown to indicate that the transaction has been marked for rollback only.
        SystemException - Thrown if the transaction manager encounters an unexpected error condition.
      • delistResource

        public boolean delistResource​(XAResource xaRes,
                                      int flag)
                               throws IllegalStateException,
                                      SystemException
        Description copied from interface: javax.transaction.Transaction
        Disassociate the resource specified from the transaction associated with the target Transaction object.
        Specified by:
        delistResource in interface Transaction
        Parameters:
        xaRes - The XAResource object associated with the resource (connection).
        flag - One of the values of TMSUCCESS, TMSUSPEND, or TMFAIL.
        Returns:
        true if the resource was delisted successfully; otherwise false.
        Throws:
        IllegalStateException - Thrown if the transaction in the target object is inactive.
        SystemException - Thrown if the transaction manager encounters an unexpected error condition.
      • addBranchXid

        public org.apache.geronimo.transaction.manager.TransactionImpl.TransactionBranch addBranchXid​(XAResource xaRes,
                                                                                                      Xid branchId)