Class TransactionImple

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

public class TransactionImple extends Object implements jakarta.transaction.Transaction, Transaction
An implementation of jakarta.transaction.Transaction.
Since:
JTS 1.2.4.
Version:
$Id: TransactionImple.java 2342 2006-03-30 13:06:17Z $
Author:
Mark Little (mark_little@hp.com)
  • Field Details Link icon

  • Constructor Details Link icon

  • 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()
      TransactionImple (which could be a proxy to the remote transaction) will return up to two different hashCodes. It will return a valid hashcode if the remote transaction is active and it will return -1 if the transaction is no longer active. The hashcode is the uid of the transaction, when the transaction completes it no longer has a uid in theory hence the -1. With raw JTA as we don't reset the uid when the transaction completes it will still get a hashcode based off the uid. Return -1 if we fail.
      Overrides:
      hashCode in class Object
    • getControlWrapper Link icon

      public com.arjuna.ats.internal.jts.ControlWrapper getControlWrapper()
    • commit Link icon

      public void commit() throws jakarta.transaction.RollbackException, jakarta.transaction.HeuristicMixedException, jakarta.transaction.HeuristicRollbackException, SecurityException, jakarta.transaction.SystemException, IllegalStateException
      We will 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. The OTS interfaces do not allow a differentiation.
      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
    • 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
      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
    • 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()
      Creates if does not exist and adds to our internal mapping table.
    • getTransaction Link icon

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

      public final void shutdown()
    • 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
      Throws:
      jakarta.transaction.RollbackException
      jakarta.transaction.HeuristicMixedException
      jakarta.transaction.HeuristicRollbackException
      SecurityException
      jakarta.transaction.SystemException
      IllegalStateException
    • rollbackAndDisassociate Link icon

      protected void rollbackAndDisassociate() throws IllegalStateException, SecurityException, jakarta.transaction.SystemException
      Throws:
      IllegalStateException
      SecurityException
      jakarta.transaction.SystemException
    • baseXid Link icon

      protected Xid baseXid()
      If this is an imported JCA transaction, then this method will return the Xid we should pretend to be. Otherwise it'll return null and we will generate our own Xid.
      Returns:
      null for a pure ATS transaction, otherwise a valid JCA imported Xid.
    • putTransaction Link icon

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

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

      protected boolean endSuspendedRMs()
      If there are any suspended RMs then we should call end on them before the transaction is terminated.
    • 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