|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Allows the application to define units of work, while
maintaining abstraction from the underlying transaction
implementation (eg. JTA, JDBC).
A transaction is associated with a Session and is
usually instantiated by a call to Session.beginTransaction().
A single session might span multiple transactions since
the notion of a session (a conversation between the application
and the datastore) is of coarser granularity than the notion of
a transaction. However, it is intended that there be at most one
uncommitted Transaction associated with a particular
Session at any time.
Implementors are not intended to be threadsafe.
Session.beginTransaction()
,
TransactionFactory
Method Summary | |
void |
begin()
Begin a new transaction. |
void |
commit()
Flush the associated Session and end the unit of work. |
boolean |
isActive()
Is this transaction still active? |
void |
registerSynchronization(Synchronization synchronization)
Register a user synchronization callback for this transaction |
void |
rollback()
Force the underlying transaction to roll back. |
void |
setTimeout(int seconds)
Set the transaction timeout for any transaction started by a subsequent call to begin() on this instance. |
boolean |
wasCommitted()
Check if this transaction was successfully committed. |
boolean |
wasRolledBack()
Was this transaction rolled back or set to rollback only? |
Method Detail |
public void begin() throws HibernateException
HibernateException
public void commit() throws HibernateException
HibernateException
public void rollback() throws HibernateException
HibernateException
public boolean wasRolledBack() throws HibernateException
HibernateException
public boolean wasCommitted() throws HibernateException
HibernateException
public boolean isActive() throws HibernateException
HibernateException
public void registerSynchronization(Synchronization synchronization) throws HibernateException
HibernateException
public void setTimeout(int seconds)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |