Session#beginTransaction(), org.hibernate.transaction.TransactionFactory
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| public boolean | Returns: boolean Treu if this local transaction is still active.Is this transaction still active? |
| public void | registerSynchronization(Synchronization
The Synchronization callback to register. synchronization)Register a user synchronization callback for this transaction. |
| public void | |
| public void | setTimeout(int
The number of seconds before a timeout. seconds)Set the transaction timeout for any transaction started by a subsequent call to begin() on this instance. |
| public boolean | Returns: boolean True if the transaction was (unequivocally) committed via this local transaction; false otherwise.Check if this transaction was successfully committed. |
| public boolean | Returns: boolean True if the transaction was rolled back via this local transaction; false otherwise.Was this transaction rolled back or set to rollback only? |
| begin | back to summary |
|---|---|
| public void begin() throws HibernateException Begin a new transaction. | |
| commit | back to summary |
|---|---|
| public void commit() throws HibernateException Flush the associated Session and end the unit of work (unless
we are in | |
| isActive | back to summary |
|---|---|
| public boolean isActive() throws HibernateException Is this transaction still active? Again, this only returns information in relation to the local transaction, not the actual underlying transaction.
| |
| registerSynchronization | back to summary |
|---|---|
| public void registerSynchronization(Synchronization synchronization) throws HibernateException Register a user synchronization callback for this transaction.
| |
| rollback | back to summary |
|---|---|
| public void rollback() throws HibernateException Force the underlying transaction to roll back. | |
| setTimeout | back to summary |
|---|---|
| public void setTimeout(int seconds) Set the transaction timeout for any transaction started by a subsequent call to begin() on this instance.
| |
| wasCommitted | back to summary |
|---|---|
| public boolean wasCommitted() throws HibernateException Check if this transaction was successfully committed.
This method could return false even after successful invocation
of
| |
| wasRolledBack | back to summary |
|---|---|
| public boolean wasRolledBack() throws HibernateException Was this transaction rolled back or set to rollback only? This only accounts for actions initiated from this local transaction. If, for example, the underlying transaction is forced to rollback via some other means, this method still reports false because the rollback was not initiated from here.
| |