public interface Transaction extends EntityTransaction
Session
and is usually initiated by a call to
SharedSessionContract.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.
Implementers are not intended to be thread-safe.Modifier and Type | Method and Description |
---|---|
TransactionStatus |
getStatus()
Get the current local status of this transaction.
|
int |
getTimeout()
Retrieve the transaction timeout set for this transaction.
|
default void |
markRollbackOnly()
Make a best effort to mark the underlying transaction for rollback only.
|
void |
registerSynchronization(Synchronization synchronization)
Register a user synchronization callback for this transaction.
|
void |
setTimeout(int seconds)
Set the transaction timeout for any transaction started by a subsequent call to
EntityTransaction.begin() on this instance. |
begin, commit, getRollbackOnly, isActive, rollback, setRollbackOnly
TransactionStatus getStatus()
void registerSynchronization(Synchronization synchronization) throws HibernateException
synchronization
- The Synchronization callback to register.HibernateException
- Indicates a problem registering the synchronization.void setTimeout(int seconds)
EntityTransaction.begin()
on this instance.seconds
- The number of seconds before a timeout.int getTimeout()
default void markRollbackOnly()
Copyright © 2001-2022 Red Hat, Inc. All Rights Reserved.