| javax.transaction.TransactionManager
TransactionManager | public interface TransactionManager (Code) | | The TransactionManager interface defines the methods that allow an
application server to manage transaction boundaries.
|
Method Summary | |
public void | begin() Create a new transaction and associate it with the current thread. | public void | commit() Complete the transaction associated with the current thread. | public int | getStatus() Obtain the status of the transaction associated with the current thread.
The transaction status. | public Transaction | getTransaction() Get the transaction object that represents the transaction
context of the calling thread. | public void | resume(Transaction tobj) Resume the transaction context association of the calling thread
with the transaction represented by the supplied Transaction object. | public void | rollback() Roll back the transaction associated with the current thread. | public void | setRollbackOnly() Modify the transaction associated with the current thread such that
the only possible outcome of the transaction is to roll back the
transaction. | public void | setTransactionTimeout(int seconds) Modify the timeout value that is associated with transactions started
by the current thread with the begin method.
If an application has not called this method, the transaction
service uses some default value for the transaction timeout.
Parameters: seconds - The value of the timeout in seconds. | public Transaction | suspend() Suspend the transaction currently associated with the calling
thread and return a Transaction object that represents the
transaction context being suspended. |
begin | public void begin() throws NotSupportedException, SystemException(Code) | | Create a new transaction and associate it with the current thread.
exception: NotSupportedException - Thrown if the thread is alreadyassociated with a transaction and the Transaction Managerimplementation does not support nested transactions. exception: SystemException - Thrown if the transaction managerencounters an unexpected error condition. |
getStatus | public int getStatus() throws SystemException(Code) | | Obtain the status of the transaction associated with the current thread.
The transaction status. If no transaction is associated withthe current thread, this method returns the Status.NoTransactionvalue. exception: SystemException - Thrown if the transaction managerencounters an unexpected error condition. |
getTransaction | public Transaction getTransaction() throws SystemException(Code) | | Get the transaction object that represents the transaction
context of the calling thread.
the Transaction object representing thetransaction associated with the calling thread. exception: SystemException - Thrown if the transaction managerencounters an unexpected error condition. |
resume | public void resume(Transaction tobj) throws InvalidTransactionException, IllegalStateException, SystemException(Code) | | Resume the transaction context association of the calling thread
with the transaction represented by the supplied Transaction object.
When this method returns, the calling thread is associated with the
transaction context specified.
Parameters: tobj - The Transaction object that represents thetransaction to be resumed. exception: InvalidTransactionException - Thrown if the parametertransaction object contains an invalid transaction. exception: IllegalStateException - Thrown if the thread is alreadyassociated with another transaction. exception: SystemException - Thrown if the transaction managerencounters an unexpected error condition. |
setRollbackOnly | public void setRollbackOnly() throws IllegalStateException, SystemException(Code) | | Modify the transaction associated with the current thread such that
the only possible outcome of the transaction is to roll back the
transaction.
exception: IllegalStateException - Thrown if the current thread isnot associated with a transaction. exception: SystemException - Thrown if the transaction managerencounters an unexpected error condition. |
setTransactionTimeout | public void setTransactionTimeout(int seconds) throws SystemException(Code) | | Modify the timeout value that is associated with transactions started
by the current thread with the begin method.
If an application has not called this method, the transaction
service uses some default value for the transaction timeout.
Parameters: seconds - The value of the timeout in seconds. If the value is zero,the transaction service restores the default value. If the valueis negative a SystemException is thrown. exception: SystemException - Thrown if the transaction managerencounters an unexpected error condition. |
suspend | public Transaction suspend() throws SystemException(Code) | | Suspend the transaction currently associated with the calling
thread and return a Transaction object that represents the
transaction context being suspended. If the calling thread is
not associated with a transaction, the method returns a null
object reference. When this method returns, the calling thread
is not associated with a transaction.
Transaction object representing the suspended transaction. exception: SystemException - Thrown if the transaction managerencounters an unexpected error condition. |
|
|