Class TransactionImpl

java.lang.Object
org.hibernate.engine.transaction.internal.TransactionImpl
All Implemented Interfaces:
EntityTransaction, TransactionImplementor, Transaction

public class TransactionImpl extends Object implements TransactionImplementor
Author:
Andrea Boriero, Steve Ebersole
  • Constructor Details

  • Method Details

    • begin

      public void begin()
      Description copied from interface: EntityTransaction
      Start a resource transaction.
      Specified by:
      begin in interface EntityTransaction
    • commit

      public void commit()
      Description copied from interface: EntityTransaction
      Commit the current resource transaction, writing any unflushed changes to the database.
      Specified by:
      commit in interface EntityTransaction
    • internalGetTransactionDriverControl

      public TransactionCoordinator.TransactionDriver internalGetTransactionDriverControl()
    • rollback

      public void rollback()
      Description copied from interface: EntityTransaction
      Roll back the current resource transaction.
      Specified by:
      rollback in interface EntityTransaction
    • isActive

      public boolean isActive()
      Description copied from interface: EntityTransaction
      Indicate whether a resource transaction is in progress.
      Specified by:
      isActive in interface EntityTransaction
      Returns:
      boolean indicating whether transaction is in progress
    • isActive

      public boolean isActive(boolean isMarkedForRollbackConsideredActive)
      Description copied from interface: TransactionImplementor
      Indicate whether a resource transaction is in progress.
      Specified by:
      isActive in interface TransactionImplementor
      Parameters:
      isMarkedForRollbackConsideredActive - whether to consider TransactionStatus.MARKED_ROLLBACK as active.
      Returns:
      boolean indicating whether transaction is in progress
    • getStatus

      public TransactionStatus getStatus()
      Description copied from interface: Transaction
      Get the current status of this transaction.
      Specified by:
      getStatus in interface Transaction
    • registerSynchronization

      public void registerSynchronization(Synchronization synchronization) throws HibernateException
      Description copied from interface: Transaction
      Register a user synchronization callback for this transaction.
      Specified by:
      registerSynchronization in interface Transaction
      Parameters:
      synchronization - The Synchronization callback to register.
      Throws:
      HibernateException - Indicates a problem registering the synchronization.
    • setTimeout

      public void setTimeout(int seconds)
      Description copied from interface: Transaction
      Set the transaction timeout for any transaction started by any subsequent call to EntityTransaction.begin() on this instance.
      Specified by:
      setTimeout in interface Transaction
      Parameters:
      seconds - The number of seconds before a timeout.
    • getTimeout

      public int getTimeout()
      Description copied from interface: Transaction
      Retrieve the transaction timeout set for this instance. A negative integer indicates that no timeout has been set.
      Specified by:
      getTimeout in interface Transaction
      Returns:
      The timeout, in seconds.
    • markRollbackOnly

      public void markRollbackOnly()
      Description copied from interface: Transaction
      Attempt to mark the underlying transaction for rollback only.
      Specified by:
      markRollbackOnly in interface Transaction
    • setRollbackOnly

      public void setRollbackOnly()
      Description copied from interface: EntityTransaction
      Mark the current resource transaction so that the only possible outcome of the transaction is for the transaction to be rolled back.
      Specified by:
      setRollbackOnly in interface EntityTransaction
    • getRollbackOnly

      public boolean getRollbackOnly()
      Description copied from interface: EntityTransaction
      Determine whether the current resource transaction has been marked for rollback.
      Specified by:
      getRollbackOnly in interface EntityTransaction
      Returns:
      boolean indicating whether the transaction has been marked for rollback
    • allowFailedCommitToPhysicallyRollback

      protected boolean allowFailedCommitToPhysicallyRollback()