|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface UserTransaction
Defines the methods that allow an application to explicitly manage transaction boundaries.
A UserTransaction can be retrieved from the session that
is associated to the current thread from the session context:
UserTransaction trx = SessionContextFactory.getContext().getUserTransaction();
SessionContext.getUserTransaction(),
SessionContextFactory| 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. |
boolean |
isRollbackOnly()
Returns true if the only possible outcome of the transaction that is associated with the current thread is to roll back the transaction. |
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. |
| Method Detail |
|---|
void begin()
throws SystemException
SystemException - Thrown if the transaction manager encounters an unexpected
error condition.
IllegalStateException - Thrown if the transaction is already started
void commit()
throws SystemException,
RollbackException
SystemException - Thrown if the transaction manager encounters an unexpected
error condition.
RollbackException - Thrown to indicate that the transaction has been rolled back
rather than committed.
IllegalStateException - Thrown if there the transaction was not started
void rollback()
throws SystemException
SystemException - Thrown if the transaction manager encounters an unexpected
error condition.
IllegalStateException - Thrown if there the transaction was not started
void setRollbackOnly()
throws SystemException
SystemException - Thrown if the transaction manager encounters an unexpected
error condition.
IllegalStateException - Thrown if there the transaction was not startedboolean isRollbackOnly()
IllegalStateException - Thrown if there the transaction was not started
|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||