TransactionManager
public class DefaultTransactionManager extends Object implements TransactionManager
Constructor | Description |
---|---|
DefaultTransactionManager() |
Constructor.
|
Modifier and Type | Method | Description |
---|---|---|
void |
begin() |
Begin a transaction.
|
void |
commit() |
Commit a 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 the rollback only.
|
void |
setTransactionTimeout(int timeout) |
Set the transaction timeout.
|
Transaction |
suspend() |
Suspend the transaction.
|
public void begin() throws NotSupportedException, SystemException
begin
in interface TransactionManager
NotSupportedException
- when a nested transaction is attempted.SystemException
- when a serious error occurs.public void commit() throws RollbackException, HeuristicMixedException, HeuristicRollbackException, SecurityException, IllegalStateException, SystemException
commit
in interface TransactionManager
RollbackException
- when a rollback error occurs.HeuristicMixedException
- when heuristics are being mixed.HeuristicRollbackException
- when a rollback error occurs.SecurityException
- when a security error occurs.IllegalStateException
- when the transaction is not active.SystemException
- when a serious error occurs.public int getStatus() throws SystemException
getStatus
in interface TransactionManager
SystemException
- when a serious error occurs.public Transaction getTransaction() throws SystemException
getTransaction
in interface TransactionManager
SystemException
- when a serious error occurs.public void resume(Transaction transaction) throws InvalidTransactionException, IllegalStateException, SystemException
resume
in interface TransactionManager
transaction
- the transaction.InvalidTransactionException
- when the transaction could not be
found.IllegalStateException
- when the transaction is not active.SystemException
- when a serious error occurs.public void rollback() throws IllegalStateException, SecurityException, SystemException
rollback
in interface TransactionManager
IllegalStateException
- when the transaction is not active.SecurityException
- when a security error occurs.SystemException
- when a serious error occurs.public void setRollbackOnly() throws IllegalStateException, SystemException
setRollbackOnly
in interface TransactionManager
IllegalStateException
- when the transaction is not active.SystemException
- when a serious error occurs.public void setTransactionTimeout(int timeout) throws SystemException
setTransactionTimeout
in interface TransactionManager
timeout
- the timeout.SystemException
- when a serious error occurs.public Transaction suspend() throws SystemException
suspend
in interface TransactionManager
SystemException
- when a serious error occurs.Copyright © 2020 Piranha Cloud. All rights reserved.