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

public class TransactionImple extends TransactionImple
  • Constructor Details

    • TransactionImple

      public TransactionImple(AtomicTransaction imported)
      Create a new transaction with the specified timeout.
  • Method Details

    • commit

      public void commit() throws jakarta.transaction.RollbackException, jakarta.transaction.HeuristicMixedException, jakarta.transaction.HeuristicRollbackException, SecurityException, jakarta.transaction.SystemException, IllegalStateException
      This is a subordinate transaction, so any attempt to commit it or roll it back directly, should fail.
      Specified by:
      commit in interface jakarta.transaction.Transaction
      Overrides:
      commit in class TransactionImple
      Throws:
      jakarta.transaction.RollbackException
      jakarta.transaction.HeuristicMixedException
      jakarta.transaction.HeuristicRollbackException
      SecurityException
      jakarta.transaction.SystemException
      IllegalStateException
    • rollback

      public void rollback() throws IllegalStateException, SecurityException, jakarta.transaction.SystemException
      This is a subordinate transaction, so any attempt to commit it or roll it back directly, should fail.
      Specified by:
      rollback in interface jakarta.transaction.Transaction
      Overrides:
      rollback in class TransactionImple
      Throws:
      IllegalStateException
      SecurityException
      jakarta.transaction.SystemException
    • doPrepare

      public int doPrepare()
      Drive the subordinate transaction through the prepare phase. Any enlisted participants will also be prepared as a result.
      Returns:
      a TwoPhaseOutcome representing the result.
      Throws:
      jakarta.transaction.SystemException - thrown if any error occurs.
    • doCommit

      public boolean doCommit() throws IllegalStateException, jakarta.transaction.HeuristicMixedException, jakarta.transaction.HeuristicRollbackException, jakarta.transaction.HeuristicCommitException, jakarta.transaction.SystemException
      Drive the subordinate transaction to commit. It must have previously been prepared.
      Returns:
      true if the transaction was committed
      Throws:
      IllegalStateException - thrown if the transaction has not been prepared or is unknown.
      jakarta.transaction.HeuristicMixedException - thrown if a heuristic mixed outcome occurs (where some participants committed whilst others rolled back).
      jakarta.transaction.HeuristicRollbackException - thrown if the transaction rolled back.
      jakarta.transaction.SystemException - thrown if some other error occurs.
      jakarta.transaction.HeuristicCommitException
    • doRollback

      public void doRollback() throws IllegalStateException, jakarta.transaction.HeuristicMixedException, jakarta.transaction.HeuristicCommitException, jakarta.transaction.HeuristicRollbackException, jakarta.transaction.SystemException
      Drive the subordinate transaction to roll back. It need not have been previously prepared.
      Throws:
      IllegalStateException - thrown if the transaction is not known by the system or has been previously terminated.
      jakarta.transaction.HeuristicMixedException - thrown if a heuristic mixed outcome occurs (can only happen if the transaction was previously prepared and then only if some participants commit whilst others roll back).
      jakarta.transaction.HeuristicCommitException - thrown if the transaction commits (can only happen if it was previously prepared).
      jakarta.transaction.SystemException - thrown if any other error occurs.
      jakarta.transaction.HeuristicRollbackException
    • doOnePhaseCommit

      public void doOnePhaseCommit() throws IllegalStateException, jakarta.transaction.RollbackException, jakarta.transaction.HeuristicMixedException, jakarta.transaction.SystemException
      Drive the transaction to commit. It should not have been previously prepared and will be the only resource in the global transaction.
      Throws:
      IllegalStateException - if the transaction has already terminated
      jakarta.transaction.HeuristicRollbackException - thrown if the transaction rolls back.
      jakarta.transaction.RollbackException
      jakarta.transaction.HeuristicMixedException
      jakarta.transaction.SystemException
    • doForget

      public void doForget() throws IllegalStateException
      Called to tell the transaction to forget any heuristics.
      Throws:
      IllegalStateException - thrown if the transaction cannot be found.
    • doBeforeCompletion

      public boolean doBeforeCompletion() throws jakarta.transaction.SystemException
      Throws:
      jakarta.transaction.SystemException
    • toString

      public String toString()
      Overrides:
      toString in class TransactionImple
    • commitAndDisassociate

      protected void commitAndDisassociate() throws jakarta.transaction.RollbackException, jakarta.transaction.HeuristicMixedException, jakarta.transaction.HeuristicRollbackException, SecurityException, jakarta.transaction.SystemException, IllegalStateException
      Overrides:
      commitAndDisassociate in class TransactionImple
      Throws:
      jakarta.transaction.RollbackException
      jakarta.transaction.HeuristicMixedException
      jakarta.transaction.HeuristicRollbackException
      SecurityException
      jakarta.transaction.SystemException
      IllegalStateException
    • rollbackAndDisassociate

      protected void rollbackAndDisassociate() throws IllegalStateException, SecurityException, jakarta.transaction.SystemException
      Overrides:
      rollbackAndDisassociate in class TransactionImple
      Throws:
      IllegalStateException
      SecurityException
      jakarta.transaction.SystemException