Package javax.transaction
Interface TransactionManager
-
- All Known Implementing Classes:
DefaultTransactionManager
public interface TransactionManager
The TransactionManager API.- Author:
- Manfred Riem ([email protected])
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
begin()
Begin a new transaction.void
commit()
Commit the transaction.int
getStatus()
Get the status.Transaction
getTransaction()
Get the transaction.void
resume(Transaction transaction)
Resume the transaction.void
rollback()
Rollback the transaction.void
setRollbackOnly()
Set to rollback only.void
setTransactionTimeout(int seconds)
Set the transaction timeout.Transaction
suspend()
Suspend the transaction.
-
-
-
Method Detail
-
begin
void begin() throws NotSupportedException, SystemException
Begin a new transaction.- Throws:
NotSupportedException
- when nested transactions 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 the transaction was partially committed.HeuristicRollbackException
- when the transaction was rolled back.SecurityException
- when the transaction is not allowed to commit.SystemException
- when a serious error occurs.IllegalStateException
-
getStatus
int getStatus() throws SystemException
Get the status.- Returns:
- the status.
- Throws:
SystemException
- when a serious error occurs.
-
getTransaction
Transaction getTransaction() throws SystemException
Get the transaction.- Returns:
- the transaction.
- Throws:
SystemException
- when a serious error occurs.
-
resume
void resume(Transaction transaction) throws InvalidTransactionException, IllegalStateException, SystemException
Resume the transaction.- Parameters:
transaction
- the transaction to resume.- Throws:
InvalidTransactionException
- when an invalid transaction was passed in.IllegalStateException
- when the thread is already associated with a transaction.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 the transaction is not allowed to commit.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 timeout in seconds.- Throws:
SystemException
- when a serious error occurs.
-
suspend
Transaction suspend() throws SystemException
Suspend the transaction.- Returns:
- the transaction, or null if not associated with a transaction.
- Throws:
SystemException
- when a serious error occurs.
-
-