- All Known Implementing Classes:
DefaultUserTransaction
public interface UserTransaction
The UserTransaction API.
- Author:
- Manfred Riem ([email protected])
-
Method Summary
Modifier and Type Method Description void
begin()
Begin the transaction.void
commit()
Commit the transaction.int
getStatus()
Get the status.void
rollback()
Rollback the transaction.void
setRollbackOnly()
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, java.lang.SecurityException, java.lang.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.java.lang.SecurityException
- when not allowed to commit the transaction.java.lang.IllegalStateException
- when not associated with a transaction.SystemException
- when a serious error occurs.
-
getStatus
Get the status.- Returns:
- the status.
- Throws:
SystemException
- when a serious error occurs.
-
rollback
void rollback() throws java.lang.IllegalStateException, java.lang.SecurityException, SystemExceptionRollback the transaction.- Throws:
java.lang.IllegalStateException
- when not associated with a transaction.java.lang.SecurityException
- when not allowed to rollback the transaction.SystemException
- when a serious error occurs.
-
setRollbackOnly
Set to rollback only.- Throws:
java.lang.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.
-