Class TransactionImpl

java.lang.Object
org.apache.geronimo.transaction.manager.TransactionImpl
All Implemented Interfaces:
javax.transaction.Transaction

public class TransactionImpl extends Object implements javax.transaction.Transaction
Basic local transaction with support for multiple resources.
  • Constructor Details

  • Method Details

    • 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 javax.transaction.Transaction
      Returns:
      The transaction status. If no transaction is associated with the target object, this method returns the Status.NoTransaction value.
    • getResource

      public Object getResource(Object key)
    • getRollbackOnly

      public boolean getRollbackOnly()
    • getTransactionKey

      public Object getTransactionKey()
    • getTransactionStatus

      public int getTransactionStatus()
    • putResource

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

      public void registerInterposedSynchronization(javax.transaction.Synchronization synchronization)
    • setRollbackOnly

      public void setRollbackOnly() throws IllegalStateException
      Description copied from interface: javax.transaction.Transaction
      Modify the transaction associated with the target object such that the only possible outcome of the transaction is to roll back the transaction.
      Specified by:
      setRollbackOnly in interface javax.transaction.Transaction
      Throws:
      IllegalStateException - Thrown if the target object is not associated with any transaction.
    • setRollbackOnly

      public void setRollbackOnly(Throwable reason)
    • registerSynchronization

      public void registerSynchronization(javax.transaction.Synchronization synch) throws IllegalStateException, javax.transaction.RollbackException, javax.transaction.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 javax.transaction.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.
      javax.transaction.RollbackException - Thrown to indicate that the transaction has been marked for rollback only.
      javax.transaction.SystemException - Thrown if the transaction manager encounters an unexpected error condition.
    • enlistResource

      public boolean enlistResource(XAResource xaRes) throws IllegalStateException, javax.transaction.RollbackException, javax.transaction.SystemException
      Description copied from interface: javax.transaction.Transaction
      Enlist the resource specified with the transaction associated with the target Transaction object.
      Specified by:
      enlistResource in interface javax.transaction.Transaction
      Parameters:
      xaRes - The XAResource object associated with the resource (connection).
      Returns:
      true if the resource was enlisted successfully; otherwise false.
      Throws:
      IllegalStateException - Thrown if the transaction in the target object is in the prepared state or the transaction is inactive.
      javax.transaction.RollbackException - Thrown to indicate that the transaction has been marked for rollback only.
      javax.transaction.SystemException - Thrown if the transaction manager encounters an unexpected error condition.
    • delistResource

      public boolean delistResource(XAResource xaRes, int flag) throws IllegalStateException, javax.transaction.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 javax.transaction.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.
      javax.transaction.SystemException - Thrown if the transaction manager encounters an unexpected error condition.
    • commit

      public void commit() throws javax.transaction.HeuristicMixedException, javax.transaction.HeuristicRollbackException, javax.transaction.RollbackException, SecurityException, javax.transaction.SystemException
      Description copied from interface: javax.transaction.Transaction
      Complete the transaction represented by this Transaction object.
      Specified by:
      commit in interface javax.transaction.Transaction
      Throws:
      javax.transaction.HeuristicMixedException - Thrown to indicate that a heuristic decision was made and that some relevant updates have been committed while others have been rolled back.
      javax.transaction.HeuristicRollbackException - Thrown to indicate that a heuristic decision was made and that all relevant updates have been rolled back.
      javax.transaction.RollbackException - Thrown to indicate that the transaction has been rolled back rather than committed.
      SecurityException - Thrown to indicate that the thread is not allowed to commit the transaction.
      javax.transaction.SystemException - Thrown if the transaction manager encounters an unexpected error condition.
    • rollback

      public void rollback() throws IllegalStateException, javax.transaction.SystemException
      Description copied from interface: javax.transaction.Transaction
      Rollback the transaction represented by this Transaction object.
      Specified by:
      rollback in interface javax.transaction.Transaction
      Throws:
      IllegalStateException - Thrown if the transaction in the target object is in the prepared state or the transaction is inactive.
      javax.transaction.SystemException - Thrown if the transaction manager encounters an unexpected error condition.
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • addBranchXid

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