| javax.transaction.TransactionManager
TransactionManager | public interface TransactionManager (Code) | | The TransactionManager interface defines the methods that allow an
application server to manage transactions on behalf of the applications.
User applications should not use this interface directly, but use
UserTransaction insted if they need to do their own transaction
management.
Internally, the transaction manager associates transactions with threads,
and the methods here operate on the transaction associated with the
calling thread.
version: $Revision: 57196 $ |
Method Summary | |
public void | begin() Starts a new transaction, and associate it with the calling thread. | public void | commit() Commit the transaction associated with the calling thread. | public int | getStatus() Get the status of the transaction associated with the calling thread.
The status of the transaction. | public Transaction | getTransaction() Get the transaction associated with the calling thread. | public void | resume(Transaction tobj) Resume the association of the calling thread with the given
transaction. | public void | rollback() Rolls back the transaction associated with the calling thread.
throws: IllegalStateException - If the transaction is in a statewhere it cannot be rolled back. | public void | setRollbackOnly() Mark the transaction associated with the calling thread for rollback
only.
throws: IllegalStateException - If the transaction is in a statewhere it cannot be rolled back. | public void | setTransactionTimeout(int seconds) Change the transaction timeout for transactions started by the calling
thread with the
TransactionManager.begin() method.
Parameters: seconds - The new timeout value, in seconds. | public Transaction | suspend() Suspend the association the calling thread has to a transaction,
and return the suspended transaction. |
getStatus | public int getStatus() throws SystemException(Code) | | Get the status of the transaction associated with the calling thread.
The status of the transaction. This is one of theStatus constants. If no transaction is associatedwith the calling thread,Status.STATUS_NO_TRANSACTION is returned. throws: SystemException - If the transaction service fails in anunexpected way. |
getTransaction | public Transaction getTransaction() throws SystemException(Code) | | Get the transaction associated with the calling thread.
The transaction associated with the calling thread, ornull if the calling thread is not associatedwith a transaction. throws: SystemException - If the transaction service fails in anunexpected way. |
setTransactionTimeout | public void setTransactionTimeout(int seconds) throws SystemException(Code) | | Change the transaction timeout for transactions started by the calling
thread with the
TransactionManager.begin() method.
Parameters: seconds - The new timeout value, in seconds. If this parameteris 0 , the timeout value is reset to the defaultvalue. throws: SystemException - If the transaction service fails in anunexpected way. |
suspend | public Transaction suspend() throws SystemException(Code) | | Suspend the association the calling thread has to a transaction,
and return the suspended transaction.
When returning from this method, the calling thread is no longer
associated with a transaction.
The transaction that the calling thread was associated with,or null if the calling thread was not associatedwith a transaction. throws: SystemException - If the transaction service fails in anunexpected way. |
|
|