Interface SubordinateTransaction
- All Superinterfaces:
org.jboss.tm.ImportedTransaction
,jakarta.transaction.Transaction
- All Known Implementing Classes:
TransactionImple
,TransactionImple
-
Method Summary
Modifier and TypeMethodDescriptionboolean
baseXid()
boolean
Run beforeCompletion on Synchronizations.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.get_uid()
Listing deferred throwables gathered during the transaction processing.void
recover()
boolean
Informs if deferred throwables are supported by implementation.Methods inherited from interface org.jboss.tm.ImportedTransaction
getId
Methods inherited from interface jakarta.transaction.Transaction
commit, delistResource, enlistResource, getStatus, registerSynchronization, rollback, setRollbackOnly
-
Method Details
-
doPrepare
int doPrepare()Drive the subordinate transaction through the prepare phase. Any enlisted participants will also be prepared as a result.- Specified by:
doPrepare
in interfaceorg.jboss.tm.ImportedTransaction
- Returns:
- a TwoPhaseOutcome representing the result.
-
doCommit
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.- Specified by:
doCommit
in interfaceorg.jboss.tm.ImportedTransaction
- Returns:
- true, if the transaction was fully committed, false if there was a transient error
- 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
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.- Specified by:
doRollback
in interfaceorg.jboss.tm.ImportedTransaction
- 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
void doOnePhaseCommit() throws IllegalStateException, jakarta.transaction.HeuristicMixedException, jakarta.transaction.SystemException, jakarta.transaction.RollbackExceptionDrive the transaction to commit. It should not have been previously prepared and will be the only resource in the global transaction.- Specified by:
doOnePhaseCommit
in interfaceorg.jboss.tm.ImportedTransaction
- Throws:
IllegalStateException
- if the transaction has already terminatedjakarta.transaction.HeuristicRollbackException
- thrown if the transaction rolls back.jakarta.transaction.HeuristicMixedException
jakarta.transaction.SystemException
jakarta.transaction.RollbackException
-
doForget
Called to tell the transaction to forget any heuristics.- Specified by:
doForget
in interfaceorg.jboss.tm.ImportedTransaction
- Throws:
IllegalStateException
- thrown if the transaction cannot be found.
-
doBeforeCompletion
boolean doBeforeCompletion() throws jakarta.transaction.SystemExceptionRun beforeCompletion on Synchronizations. Note: this will run beforeCompletion even on setRollbackOnly transactions. Users may wish to avoid calling this method in such cases, or prior to calling rollback.- Specified by:
doBeforeCompletion
in interfaceorg.jboss.tm.ImportedTransaction
- Returns:
- outcome
- Throws:
jakarta.transaction.SystemException
-
activated
boolean activated()- Specified by:
activated
in interfaceorg.jboss.tm.ImportedTransaction
-
recover
void recover()- Specified by:
recover
in interfaceorg.jboss.tm.ImportedTransaction
-
baseXid
Xid baseXid()- Specified by:
baseXid
in interfaceorg.jboss.tm.ImportedTransaction
-
get_uid
Uid get_uid() -
getDeferredThrowables
Listing deferred throwables gathered during the transaction processing. This list contains exceptions thrown by transaction resources when an error occurs.
Depending on the transaction stage the particular method returns only an error code e.g.
ImportedTransaction.doPrepare()
then the controller of the subordinate transaction throws its own exception and it could pack these throwables in some details. Other methods asImportedTransaction.doCommit()
throws an exception but those exception does not contain underlying exceptions like those coming from resource failures.Normally exceptions taken by this call are put under suppressed part of the thrown exception.
JTS implementation of the
SubordinateTransaction
interface does not support the deferred throwable based on the limitation of ORB protocol. This method called on JTS implementation causesUnsupportedOperationException
being thrown.- Specified by:
getDeferredThrowables
in interfaceorg.jboss.tm.ImportedTransaction
- Returns:
- list of throwables causing the failure state of the transaction
-
supportsDeferredThrowables
boolean supportsDeferredThrowables()Informs if deferred throwables are supported by implementation. See
ImportedTransaction.getDeferredThrowables()
.- JTS does not support deffered throwable, you can expect false.
- JTA suppors deffered throwable, you can expect true.
- Specified by:
supportsDeferredThrowables
in interfaceorg.jboss.tm.ImportedTransaction
- Returns:
- true, if getting deffered throwables is supported by subordinate transaction implementation, false otherwise
-