- All Known Implementing Classes:
DefaultTransactionManager
public interface TransactionManager
The TransactionManager API.
- Author:
- Manfred Riem ([email protected])
-
Method Summary
Modifier and TypeMethodDescriptionvoid
begin()
Begin a new transaction.void
commit()
Commit the transaction.int
Returns the status.Returns the transaction.void
resume(Transaction transaction)
Resume the transaction.void
rollback()
Rollback the transaction.void
Set to rollback only.void
setTransactionTimeout(int seconds)
Set the transaction timeout.suspend()
Suspend the transaction.
-
Method Details
-
begin
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, SystemExceptionCommit 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
Returns the status.- Returns:
- the status
- Throws:
SystemException
- when a serious error occurs.
-
getTransaction
Returns the transaction.- Returns:
- the transaction
- Throws:
SystemException
- when a serious error occurs.
-
resume
void resume(Transaction transaction) throws InvalidTransactionException, IllegalStateException, SystemExceptionResume 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
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
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 timeout in seconds.- Throws:
SystemException
- when a serious error occurs.
-
suspend
Suspend the transaction.- Returns:
- the transaction, or null if not associated with a transaction.
- Throws:
SystemException
- when a serious error occurs.
-