Interface SubordinateTransactionControl
-
public interface SubordinateTransactionControlThe control interface for subordinate transactions. This interface is used in the following cases:- When a subordinate transaction is locally inflowed, an instance of this interface is used to control the lifecycle of the local transaction (the transaction's lifecycle methods are blocked in this case).
- The local handle for a subordinate transaction implements this interface.
- Author:
- David M. Lloyd
-
-
Field Summary
Fields Modifier and Type Field Description static SubordinateTransactionControlEMPTYAn empty subordinate transaction controller.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidbeforeCompletion()Perform before-commit operations, including running all transaction synchronizations.voidcommit(boolean onePhase)Commit a transaction, either in a single phase or after a previous prepare.voidend(int flags)End work on behalf of a transaction branch, disassociating the subordinate from the transaction branch.voidforget()Forget the (previously prepared) transaction.intprepare()Prepare the transaction.voidrollback()Roll back the subordinate.
-
-
-
Field Detail
-
EMPTY
static final SubordinateTransactionControl EMPTY
An empty subordinate transaction controller.
-
-
Method Detail
-
rollback
void rollback() throws XAExceptionRoll back the subordinate. In the event of error, the following error codes are possible:- Throws:
XAException- (with one of the above error codes) if an error occurs
-
end
void end(int flags) throws XAException
End work on behalf of a transaction branch, disassociating the subordinate from the transaction branch. Theflagsparameter may equal one of the following:XAResource.TMFAILindicating that the transaction work has failed, and that the subordinate may mark the transaction as rollback-onlyXAResource.TMSUCCESSindicating that the work has completed successfully and that a subsequentprepare()is likely
- Parameters:
flags- one of the valid flag values:TMSUSPEND,TMFAIL, orTMSUCCESS- Throws:
XAException- (with one of the above error codes) if an error occurs
-
beforeCompletion
void beforeCompletion() throws XAExceptionPerform before-commit operations, including running all transaction synchronizations. In the event of an error, the following error codes are possible:- Throws:
XAException- (with one of the above error codes) if an error occurs
-
prepare
int prepare() throws XAExceptionPrepare the transaction. If before-commit processing was not yet run, it is run. In the event of an error, the following error codes are possible:- Returns:
XAResource.XA_OKorXAResource.XA_RDONLY- Throws:
XAException- (with one of the above error codes) if an error occurs
-
forget
void forget() throws XAExceptionForget the (previously prepared) transaction. In the event of error, the following error codes are possible:- Throws:
XAException- (with one of the above error codes) if an error occurs
-
commit
void commit(boolean onePhase) throws XAExceptionCommit a transaction, either in a single phase or after a previous prepare. In the event of error, the following error codes are possible:XAException.XAER_RMERRXAException.XAER_RMFAILXAException.XAER_INVALXAException.XAER_PROTOXAException.XA_HEURHAZXAException.XA_HEURCOMXAException.XA_HEURRBXAException.XA_HEURMIX
onePhaseflag istrue, one of the following error codes is also possible:- Parameters:
onePhase-trueto commit in a single phase,falseto commit after prepare- Throws:
XAException- (with one of the above error codes) if an error occurs
-
-