Class TransactionImple

java.lang.Object
com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple
All Implemented Interfaces:
Transaction, jakarta.transaction.Transaction
Direct Known Subclasses:
TransactionImple

public class TransactionImple extends Object implements jakarta.transaction.Transaction, Transaction
  • Field Details Link icon

  • Constructor Details Link icon

    • TransactionImple Link icon

      public TransactionImple(int timeout)
      Create a new transaction with the specified timeout.
    • TransactionImple Link icon

      protected TransactionImple()
    • TransactionImple Link icon

      protected TransactionImple(BasicAction curr)
      Create a new TransactionImple representation of a specified transaction.
  • Method Details Link icon

    • equals Link icon

      public boolean equals(Object obj)
      Overloads Object.equals()
      Overrides:
      equals in class Object
    • hashCode Link icon

      public int hashCode()
      Return -1 if we fail.
      Overrides:
      hashCode in class Object
    • commit Link icon

      public void commit() throws jakarta.transaction.RollbackException, jakarta.transaction.HeuristicMixedException, jakarta.transaction.HeuristicRollbackException, SecurityException, jakarta.transaction.SystemException, IllegalStateException
      We should never throw a HeuristicRollbackException because if we get a HeuristicRollback from a resource, and can successfully rollback the other resources, this is then the same as having simply been forced to rollback the transaction during phase 1.
      Specified by:
      commit in interface jakarta.transaction.Transaction
      Throws:
      jakarta.transaction.RollbackException
      jakarta.transaction.HeuristicMixedException
      jakarta.transaction.HeuristicRollbackException
      SecurityException
      jakarta.transaction.SystemException
      IllegalStateException
    • rollback Link icon

      public void rollback() throws IllegalStateException, SecurityException, jakarta.transaction.SystemException
      Specified by:
      rollback in interface jakarta.transaction.Transaction
      Throws:
      IllegalStateException
      SecurityException
      jakarta.transaction.SystemException
    • setRollbackOnly Link icon

      public void setRollbackOnly() throws IllegalStateException, jakarta.transaction.SystemException
      Specified by:
      setRollbackOnly in interface jakarta.transaction.Transaction
      Throws:
      IllegalStateException
      jakarta.transaction.SystemException
    • setRollbackOnly Link icon

      public void setRollbackOnly(String reason) throws IllegalStateException, jakarta.transaction.SystemException
      Throws:
      IllegalStateException
      jakarta.transaction.SystemException
    • getStatus Link icon

      public int getStatus() throws jakarta.transaction.SystemException
      Specified by:
      getStatus in interface jakarta.transaction.Transaction
      Throws:
      jakarta.transaction.SystemException
    • registerSynchronization Link icon

      public void registerSynchronization(jakarta.transaction.Synchronization sync) throws jakarta.transaction.RollbackException, IllegalStateException, jakarta.transaction.SystemException
      Specified by:
      registerSynchronization in interface jakarta.transaction.Transaction
      Throws:
      jakarta.transaction.RollbackException
      IllegalStateException
      jakarta.transaction.SystemException
    • enlistResource Link icon

      public boolean enlistResource(XAResource xaRes) throws jakarta.transaction.RollbackException, IllegalStateException, jakarta.transaction.SystemException
      This is the JTA compliant version of the method. However, you had better know that your XAResource and family are truly compliant implementations. If they aren't then we may fail gracefully (e.g., some versions of Oracle don't work with arbitrary Xid implementations!) If the family isn't compliant, then you should use the other method and pass through a relevant XAModifier, which should address the issues we have already come across.
      Specified by:
      enlistResource in interface jakarta.transaction.Transaction
      Throws:
      jakarta.transaction.RollbackException
      IllegalStateException
      jakarta.transaction.SystemException
    • enlistResource Link icon

      public boolean enlistResource(XAResource xaRes, Object[] params) throws jakarta.transaction.RollbackException, IllegalStateException, jakarta.transaction.SystemException
      Specified by:
      enlistResource in interface Transaction
      Throws:
      jakarta.transaction.RollbackException
      IllegalStateException
      jakarta.transaction.SystemException
    • delistResource Link icon

      public boolean delistResource(XAResource xaRes, int flags) throws IllegalStateException, jakarta.transaction.SystemException
      Specified by:
      delistResource in interface jakarta.transaction.Transaction
      Throws:
      IllegalStateException
      jakarta.transaction.SystemException
    • get_uid Link icon

      public final Uid get_uid()
      Specified by:
      get_uid in interface Transaction
    • getTxId Link icon

      public final Xid getTxId()
      Specified by:
      getTxId in interface Transaction
    • getDeferredThrowables Link icon

      public List<Throwable> getDeferredThrowables()
      Returning list of throwables which are bound to transaction failure. This method is intended to be used when handling some error states. The result exception could be enriched with these returned ones.
    • supportsDeferredThrowables Link icon

      public boolean supportsDeferredThrowables()
      Method getDeferredThrowables() will return list of deferred throwables.
      Returns:
      true
    • toString Link icon

      public String toString()
      Overrides:
      toString in class Object
    • endAssociation Link icon

      public void endAssociation(Xid _tranID, XAResource _theXAResource, int xaState, int txInfoState) throws XAException
      Throws:
      XAException
    • getXAResourceState Link icon

      public int getXAResourceState(XAResource xaRes)
      Specified by:
      getXAResourceState in interface Transaction
    • setXAResourceState Link icon

      public void setXAResourceState(XAResource xaRes, int state)
    • getTransaction Link icon

      public static final TransactionImple getTransaction()
    • getTransaction Link icon

      public static final TransactionImple getTransaction(Uid id)
    • getTxLocalResource Link icon

      public Object getTxLocalResource(Object key)
      Specified by:
      getTxLocalResource in interface Transaction
    • putTxLocalResource Link icon

      public void putTxLocalResource(Object key, Object value)
      Specified by:
      putTxLocalResource in interface Transaction
    • isAlive Link icon

      public boolean isAlive()
      Specified by:
      isAlive in interface Transaction
    • commitAndDisassociate Link icon

      protected void commitAndDisassociate() throws jakarta.transaction.RollbackException, jakarta.transaction.HeuristicMixedException, jakarta.transaction.HeuristicRollbackException, SecurityException, jakarta.transaction.SystemException, IllegalStateException
      Does the same as commit, but also changes the thread-to-tx association.
      Throws:
      jakarta.transaction.RollbackException
      jakarta.transaction.HeuristicMixedException
      jakarta.transaction.HeuristicRollbackException
      SecurityException
      jakarta.transaction.SystemException
      IllegalStateException
    • baseXid Link icon

      protected Xid baseXid()
      If this is an imported transaction (via JCA) then this will be the Xid we are pretending to be. Otherwise, it will be null.
      Returns:
      null if we are a local transaction, a valid Xid if we have been imported.
    • rollbackAndDisassociate Link icon

      protected void rollbackAndDisassociate() throws IllegalStateException, SecurityException, jakarta.transaction.SystemException
      Does the same as rollback, but also changes the thread-to-tx association.
      Throws:
      IllegalStateException
      SecurityException
      jakarta.transaction.SystemException
    • endSuspendedRMs Link icon

      protected boolean endSuspendedRMs()
      If there are any suspended RMs then we should call end on them before the transaction is terminated.
    • createXid Link icon

      protected Xid createXid(boolean branch, XAModifier theModifier, XAResource xaResource) throws IOException, ObjectStoreException
      Throws:
      IOException
      ObjectStoreException
    • putTransaction Link icon

      protected static final void putTransaction(TransactionImple tx)
    • removeTransaction Link icon

      public static final void removeTransaction(TransactionImple tx)
    • getTransactions Link icon

      public static Map<Uid,jakarta.transaction.Transaction> getTransactions()
    • getResources Link icon

      public Map<XAResource,TxInfo> getResources()
      Specified by:
      getResources in interface Transaction
    • getTimeout Link icon

      public int getTimeout()
      Specified by:
      getTimeout in interface Transaction
    • getRemainingTimeoutMills Link icon

      public long getRemainingTimeoutMills()
      Specified by:
      getRemainingTimeoutMills in interface Transaction
    • getSynchronizations Link icon

      public Map<Uid,String> getSynchronizations()
      Specified by:
      getSynchronizations in interface Transaction