Class TransactionImpl
- java.lang.Object
-
- org.hibernate.engine.transaction.internal.TransactionImpl
-
- All Implemented Interfaces:
EntityTransaction,TransactionImplementor,Transaction
public class TransactionImpl extends Object implements TransactionImplementor
-
-
Constructor Summary
Constructors Constructor Description TransactionImpl(TransactionCoordinator transactionCoordinator, AbstractSharedSessionContract session)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanallowFailedCommitToPhysicallyRollback()voidbegin()voidcommit()booleangetRollbackOnly()TransactionStatusgetStatus()Get the current status of this transaction.intgetTimeout()Retrieve the transaction timeout set for this instance.TransactionCoordinator.TransactionDriverinternalGetTransactionDriverControl()booleanisActive()booleanisActive(boolean isMarkedForRollbackConsideredActive)Indicate whether a resource transaction is in progress.voidmarkRollbackOnly()Attempt to mark the underlying transaction for rollback only.voidregisterSynchronization(Synchronization synchronization)Register a usersynchronization callbackfor this transaction.voidrollback()voidsetRollbackOnly()voidsetTimeout(int seconds)Set the transaction timeout for any transaction started by any subsequent call toEntityTransaction.begin()on this instance.
-
-
-
Constructor Detail
-
TransactionImpl
public TransactionImpl(TransactionCoordinator transactionCoordinator, AbstractSharedSessionContract session)
-
-
Method Detail
-
begin
public void begin()
- Specified by:
beginin interfaceEntityTransaction
-
commit
public void commit()
- Specified by:
commitin interfaceEntityTransaction
-
internalGetTransactionDriverControl
public TransactionCoordinator.TransactionDriver internalGetTransactionDriverControl()
-
rollback
public void rollback()
- Specified by:
rollbackin interfaceEntityTransaction
-
isActive
public boolean isActive()
- Specified by:
isActivein interfaceEntityTransaction
-
isActive
public boolean isActive(boolean isMarkedForRollbackConsideredActive)
Description copied from interface:TransactionImplementorIndicate whether a resource transaction is in progress.- Specified by:
isActivein interfaceTransactionImplementor- Parameters:
isMarkedForRollbackConsideredActive- whether to considerTransactionStatus.MARKED_ROLLBACKas active.- Returns:
- boolean indicating whether transaction is in progress
-
getStatus
public TransactionStatus getStatus()
Description copied from interface:TransactionGet the current status of this transaction.- Specified by:
getStatusin interfaceTransaction
-
registerSynchronization
public void registerSynchronization(Synchronization synchronization) throws HibernateException
Description copied from interface:TransactionRegister a usersynchronization callbackfor this transaction.- Specified by:
registerSynchronizationin interfaceTransaction- Parameters:
synchronization- TheSynchronizationcallback to register.- Throws:
HibernateException- Indicates a problem registering the synchronization.
-
setTimeout
public void setTimeout(int seconds)
Description copied from interface:TransactionSet the transaction timeout for any transaction started by any subsequent call toEntityTransaction.begin()on this instance.- Specified by:
setTimeoutin interfaceTransaction- Parameters:
seconds- The number of seconds before a timeout.
-
getTimeout
public int getTimeout()
Description copied from interface:TransactionRetrieve the transaction timeout set for this instance. A negative integer indicates that no timeout has been set.- Specified by:
getTimeoutin interfaceTransaction- Returns:
- The timeout, in seconds.
-
markRollbackOnly
public void markRollbackOnly()
Description copied from interface:TransactionAttempt to mark the underlying transaction for rollback only.- Specified by:
markRollbackOnlyin interfaceTransaction
-
setRollbackOnly
public void setRollbackOnly()
- Specified by:
setRollbackOnlyin interfaceEntityTransaction
-
getRollbackOnly
public boolean getRollbackOnly()
- Specified by:
getRollbackOnlyin interfaceEntityTransaction
-
allowFailedCommitToPhysicallyRollback
protected boolean allowFailedCommitToPhysicallyRollback()
-
-