Package javax.transaction
Interface UserTransaction
-
- All Known Implementing Classes:
DefaultUserTransaction
public interface UserTransaction
The UserTransaction API.- Author:
- Manfred Riem ([email protected])
-
-
Method Summary
All Methods Instance Methods Abstract Methods 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 Detail
-
begin
void begin() throws NotSupportedException, SystemException
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, SystemException
Commit 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
int getStatus() throws SystemException
Get the status.- Returns:
- the status.
- Throws:
SystemException
- when a serious error occurs.
-
rollback
void rollback() throws IllegalStateException, SecurityException, SystemException
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
void setRollbackOnly() throws IllegalStateException, SystemException
Set to rollback only.- Throws:
IllegalStateException
- when not associated with a transaction.SystemException
- when a serious error occurs.
-
setTransactionTimeout
void setTransactionTimeout(int seconds) throws SystemException
Set the transaction timeout.- Parameters:
seconds
- the transaction timeout in seconds- Throws:
SystemException
- when a serious error occurs.
-
-