- All Known Implementing Classes:
DefaultTransaction
public interface Transaction
The Transaction API.
- Author:
- Manfred Riem ([email protected])
-
Method Summary
Modifier and Type Method Description void
commit()
Commit the transaction.boolean
delistResource(javax.transaction.xa.XAResource xaResource, int flag)
Delist the XA resource.boolean
enlistResource(javax.transaction.xa.XAResource xaResource)
Enlist the XA resource.int
getStatus()
Get the status.void
registerSynchronization(Synchronization synchronization)
Register the synchronization object.void
rollback()
Rollback the transaction.void
setRollbackOnly()
Set for rollback only.
-
Method Details
-
commit
void commit() throws RollbackException, HeuristicMixedException, HeuristicRollbackException, java.lang.SecurityException, java.lang.IllegalStateException, SystemExceptionCommit the transaction.- Throws:
RollbackException
- when the transaction has been rolled back.HeuristicMixedException
- when part of the transaction has been rolled back.HeuristicRollbackException
- when all of the transaction has been rolled back.java.lang.SecurityException
- when it was not allowed to commit.java.lang.IllegalStateException
- when the transaction is inactive.SystemException
- when a serious error occurs.
-
delistResource
boolean delistResource(javax.transaction.xa.XAResource xaResource, int flag) throws java.lang.IllegalStateException, SystemExceptionDelist the XA resource.- Parameters:
xaResource
- the XA resource.flag
- the TMxxx flag- Returns:
- true if de-listed successfully, false otherwise.
- Throws:
java.lang.IllegalStateException
- when the transaction is inactive.SystemException
- when a serious error occurs.
-
enlistResource
boolean enlistResource(javax.transaction.xa.XAResource xaResource) throws RollbackException, java.lang.IllegalStateException, SystemExceptionEnlist the XA resource.- Parameters:
xaResource
- the XA resource.- Returns:
- true if en-listed successfully, false otherwise.
- Throws:
RollbackException
- when the transaction has been marked for rollback.java.lang.IllegalStateException
- when the transaction is inactive.SystemException
- when a serious error occurs.
-
getStatus
Get the status.- Returns:
- the status of the transaction.
- Throws:
SystemException
- when a serious error occurs.
-
registerSynchronization
void registerSynchronization(Synchronization synchronization) throws RollbackException, java.lang.IllegalStateException, SystemExceptionRegister the synchronization object.- Parameters:
synchronization
- the synchronization object.- Throws:
RollbackException
- when the transaction has been marked for rollback.java.lang.IllegalStateException
- when the transaction is inactive.SystemException
- when a serious error occurs.
-
rollback
Rollback the transaction.- Throws:
java.lang.IllegalStateException
- when the transaction is inactive.SystemException
- when a serious error occurs.
-
setRollbackOnly
Set for rollback only.- Throws:
java.lang.IllegalStateException
- when the transaction is inactive.SystemException
- when a serious error occurs.
-