- All Known Implementing Classes:
DefaultUserTransaction
public interface UserTransaction
The UserTransaction API.
- Author:
- Manfred Riem ([email protected])
-
Method Summary
Modifier and TypeMethodDescriptionvoid
begin()
Begin the transaction.void
commit()
Commit the transaction.int
Returns the status.void
rollback()
Rollback the transaction.void
Set to rollback only.void
setTransactionTimeout(int seconds)
Set the transaction timeout.
-
Method Details
-
begin
Begin the transaction.- Throws:
NotSupportedException
- when nested transaction are not supported.SystemException
- when a serious error occurs.
-
commit
void commit() throws RollbackException, HeuristicMixedException, HeuristicRollbackException, SecurityException, IllegalStateException, SystemExceptionCommit the transaction.- Throws:
RollbackException
- when the transaction has been rolled back.HeuristicMixedException
- when transaction has been partially rolled back.HeuristicRollbackException
- when transaction has been rolled back.SecurityException
- when not allowed to commit the transaction.IllegalStateException
- when not associated with a transaction.SystemException
- when a serious error occurs.
-
getStatus
Returns the status.- Returns:
- the status
- Throws:
SystemException
- when a serious error occurs.
-
rollback
Rollback the transaction.- Throws:
IllegalStateException
- when not associated with a transaction.SecurityException
- when not allowed to rollback the transaction.SystemException
- when a serious error occurs.
-
setRollbackOnly
Set to rollback only.- Throws:
IllegalStateException
- when not associated with a transaction.SystemException
- when a serious error occurs.
-
setTransactionTimeout
Set the transaction timeout.- Parameters:
seconds
- the transaction timeout in seconds- Throws:
SystemException
- when a serious error occurs.
-