Class TransactionImple
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
-
Field Summary
Fields inherited from class com.arjuna.ats.internal.jta.transaction.jts.TransactionImple
_theTransaction
Fields inherited from interface com.arjuna.ats.jta.transaction.Transaction
XACONNECTION, XAMODIFIER
-
Constructor Summary
ConstructorDescriptionTransactionImple
(AtomicTransaction imported) Create a new transaction with the specified timeout. -
Method Summary
Modifier and TypeMethodDescriptionvoid
commit()
This is a subordinate transaction, so any attempt to commit it or roll it back directly, should fail.protected void
boolean
boolean
doCommit()
Drive the subordinate transaction to commit.void
doForget()
Called to tell the transaction to forget any heuristics.void
Drive the transaction to commit.int
Drive the subordinate transaction through the prepare phase.void
Drive the subordinate transaction to roll back.void
rollback()
This is a subordinate transaction, so any attempt to commit it or roll it back directly, should fail.protected void
toString()
Methods inherited from class com.arjuna.ats.internal.jta.transaction.jts.TransactionImple
baseXid, delistResource, endAssociation, endSuspendedRMs, enlistResource, enlistResource, equals, get_uid, getControlWrapper, getRemainingTimeoutMills, getResources, getStatus, getSynchronizations, getTimeout, getTransaction, getTransaction, getTransactions, getTxId, getTxLocalResource, getXAResourceState, hashCode, isAlive, putTransaction, putTxLocalResource, registerSynchronization, removeTransaction, setRollbackOnly, setXAResourceState, shutdown
-
Constructor Details
-
TransactionImple
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, IllegalStateExceptionThis is a subordinate transaction, so any attempt to commit it or roll it back directly, should fail.- Specified by:
commit
in interfacejakarta.transaction.Transaction
- Overrides:
commit
in classTransactionImple
- Throws:
jakarta.transaction.RollbackException
jakarta.transaction.HeuristicMixedException
jakarta.transaction.HeuristicRollbackException
SecurityException
jakarta.transaction.SystemException
IllegalStateException
-
rollback
public void rollback() throws IllegalStateException, SecurityException, jakarta.transaction.SystemExceptionThis is a subordinate transaction, so any attempt to commit it or roll it back directly, should fail.- Specified by:
rollback
in interfacejakarta.transaction.Transaction
- Overrides:
rollback
in classTransactionImple
- 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.SystemExceptionDrive 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.SystemExceptionDrive 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.SystemExceptionDrive 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 terminatedjakarta.transaction.HeuristicRollbackException
- thrown if the transaction rolls back.jakarta.transaction.RollbackException
jakarta.transaction.HeuristicMixedException
jakarta.transaction.SystemException
-
doForget
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
- Overrides:
toString
in classTransactionImple
-
commitAndDisassociate
protected void commitAndDisassociate() throws jakarta.transaction.RollbackException, jakarta.transaction.HeuristicMixedException, jakarta.transaction.HeuristicRollbackException, SecurityException, jakarta.transaction.SystemException, IllegalStateException- Overrides:
commitAndDisassociate
in classTransactionImple
- 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 classTransactionImple
- Throws:
IllegalStateException
SecurityException
jakarta.transaction.SystemException
-