Interface TransactionControl
- All Known Subinterfaces:
TransactionControlImplementor
public interface TransactionControl
Control for a wrapped hibernate
Transaction
.-
Method Summary
Modifier and TypeMethodDescriptionvoid
addTransactionListener
(TransactionListener listener) void
commit()
<T> T
getAttribute
(String key) boolean
Returns true whenmarkRollbackOnly()
was called.org.hibernate.resource.transaction.spi.TransactionStatus
boolean
Returns true if the transaction was started as 'rollback transaction' usingPersistenceService.beginTransaction(boolean)
.void
lock
(AdvisoryLockKey lockKey) Locks the transaction using a 'pg_advisory_xact_lock()'.void
void
removeTransactionListener
(TransactionListener listener) void
rollback()
void
setAttribute
(String key, Object value)
-
Method Details
-
commit
void commit() -
rollback
void rollback() -
markRollbackOnly
void markRollbackOnly() -
getRollbackOnly
boolean getRollbackOnly()Returns true whenmarkRollbackOnly()
was called. This will cause aRollbackException
whencommit()
is called. Code may aborted when this returns true. -
isRollbackTransaction
boolean isRollbackTransaction()Returns true if the transaction was started as 'rollback transaction' usingPersistenceService.beginTransaction(boolean)
. It cannot be set once the transaction was started. This executes a rollback instead of a commit whencommit()
is called. This is meant for 'dry-runs' when the entire transaction content should be executed. Code should not abort when this returns true, but may skip actions that won't be rolled back by the transaction. -
getStatus
org.hibernate.resource.transaction.spi.TransactionStatus getStatus() -
addTransactionListener
-
removeTransactionListener
-
lock
Locks the transaction using a 'pg_advisory_xact_lock()'. This method will block until the given lock is available. The lock will automatically be released when the current transaction is finished. -
setAttribute
-
getAttribute
-