| javax.transaction.UserTransaction
UserTransaction | public interface UserTransaction (Code) | | The UserTransaction interface defines the methods that allow an
application to explicitly manage transaction boundaries.
|
Method Summary | |
void | begin() Create a new transaction and associate it with the current thread. | void | commit() Complete the transaction associated with the current thread. | int | getStatus() Obtain the status of the transaction associated with the current thread.
The transaction status. | void | rollback() Roll back the transaction associated with the current thread. | 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. | 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. |
begin | 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 | 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. |
setRollbackOnly | 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 | 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. |
|
|