Package javax.transaction
Interface Transaction
-
- All Known Implementing Classes:
DefaultTransaction
public interface Transaction
The Transaction API.- Author:
- Manfred Riem ([email protected])
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
commit()
Commit the transaction.boolean
delistResource(XAResource xaResource, int flag)
Delist the XA resource.boolean
enlistResource(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 Detail
-
commit
void commit() throws RollbackException, HeuristicMixedException, HeuristicRollbackException, SecurityException, IllegalStateException, SystemException
Commit 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.SecurityException
- when it was not allowed to commit.IllegalStateException
- when the transaction is inactive.SystemException
- when a serious error occurs.
-
delistResource
boolean delistResource(XAResource xaResource, int flag) throws IllegalStateException, SystemException
Delist the XA resource.- Parameters:
xaResource
- the XA resource.flag
- the TMxxx flag- Returns:
- true if de-listed successfully, false otherwise.
- Throws:
IllegalStateException
- when the transaction is inactive.SystemException
- when a serious error occurs.
-
enlistResource
boolean enlistResource(XAResource xaResource) throws RollbackException, IllegalStateException, SystemException
Enlist 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.IllegalStateException
- when the transaction is inactive.SystemException
- when a serious error occurs.
-
getStatus
int getStatus() throws SystemException
Get the status.- Returns:
- the status of the transaction.
- Throws:
SystemException
- when a serious error occurs.
-
registerSynchronization
void registerSynchronization(Synchronization synchronization) throws RollbackException, IllegalStateException, SystemException
Register the synchronization object.- Parameters:
synchronization
- the synchronization object.- Throws:
RollbackException
- when the transaction has been marked for rollback.IllegalStateException
- when the transaction is inactive.SystemException
- when a serious error occurs.
-
rollback
void rollback() throws IllegalStateException, SystemException
Rollback the transaction.- Throws:
IllegalStateException
- when the transaction is inactive.SystemException
- when a serious error occurs.
-
setRollbackOnly
void setRollbackOnly() throws IllegalStateException, SystemException
Set for rollback only.- Throws:
IllegalStateException
- when the transaction is inactive.SystemException
- when a serious error occurs.
-
-