Interface TransactionControl
- All Known Subinterfaces:
TransactionControlImplementor
public interface TransactionControl
Control for a wrapped hibernate
Transaction.-
Method Summary
Modifier and TypeMethodDescriptionvoidaddTransactionListener(TransactionListener listener) voidcommit()<T> TgetAttribute(String key) booleanReturns true whenmarkRollbackOnly()was called.org.hibernate.resource.transaction.spi.TransactionStatusbooleanReturns true if the transaction was started as 'rollback transaction' usingPersistenceService.beginTransaction(boolean).voidlock(AdvisoryLockKey lockKey) Locks the transaction using a 'pg_advisory_xact_lock()'.voidvoidremoveTransactionListener(TransactionListener listener) voidrollback()voidsetAttribute(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 aRollbackExceptionwhencommit()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
-