Interface TransactionControl

All Known Subinterfaces:
TransactionControlImplementor

public interface TransactionControl
Control for a wrapped hibernate Transaction.
  • Method Details

    • commit

      void commit()
    • rollback

      void rollback()
    • markRollbackOnly

      void markRollbackOnly()
    • getRollbackOnly

      boolean getRollbackOnly()
      Returns true when markRollbackOnly() was called. This will cause a RollbackException when commit() is called. Code may aborted when this returns true.
    • isRollbackTransaction

      boolean isRollbackTransaction()
      Returns true if the transaction was started as 'rollback transaction' using PersistenceService.beginTransaction(boolean). It cannot be set once the transaction was started. This executes a rollback instead of a commit when commit() 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

      void addTransactionListener(TransactionListener listener)
    • removeTransactionListener

      void removeTransactionListener(TransactionListener listener)
    • lock

      void lock(AdvisoryLockKey lockKey)
      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

      void setAttribute(String key, Object value)
    • getAttribute

      <T> T getAttribute(String key)