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 boolean
allowFailedCommitToPhysicallyRollback()
void
begin()
void
commit()
boolean
getRollbackOnly()
TransactionStatus
getStatus()
Get the current status of this transaction.int
getTimeout()
Retrieve the transaction timeout set for this instance.TransactionCoordinator.TransactionDriver
internalGetTransactionDriverControl()
boolean
isActive()
boolean
isActive(boolean isMarkedForRollbackConsideredActive)
Indicate whether a resource transaction is in progress.void
markRollbackOnly()
Attempt to mark the underlying transaction for rollback only.void
registerSynchronization(Synchronization synchronization)
Register a usersynchronization callback
for this transaction.void
rollback()
void
setRollbackOnly()
void
setTimeout(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:
begin
in interfaceEntityTransaction
-
commit
public void commit()
- Specified by:
commit
in interfaceEntityTransaction
-
internalGetTransactionDriverControl
public TransactionCoordinator.TransactionDriver internalGetTransactionDriverControl()
-
rollback
public void rollback()
- Specified by:
rollback
in interfaceEntityTransaction
-
isActive
public boolean isActive()
- Specified by:
isActive
in interfaceEntityTransaction
-
isActive
public boolean isActive(boolean isMarkedForRollbackConsideredActive)
Description copied from interface:TransactionImplementor
Indicate whether a resource transaction is in progress.- Specified by:
isActive
in interfaceTransactionImplementor
- Parameters:
isMarkedForRollbackConsideredActive
- whether to considerTransactionStatus.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 interfaceTransaction
-
registerSynchronization
public void registerSynchronization(Synchronization synchronization) throws HibernateException
Description copied from interface:Transaction
Register a usersynchronization callback
for this transaction.- Specified by:
registerSynchronization
in interfaceTransaction
- Parameters:
synchronization
- TheSynchronization
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 toEntityTransaction.begin()
on this instance.- Specified by:
setTimeout
in interfaceTransaction
- 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 interfaceTransaction
- 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 interfaceTransaction
-
setRollbackOnly
public void setRollbackOnly()
- Specified by:
setRollbackOnly
in interfaceEntityTransaction
-
getRollbackOnly
public boolean getRollbackOnly()
- Specified by:
getRollbackOnly
in interfaceEntityTransaction
-
allowFailedCommitToPhysicallyRollback
protected boolean allowFailedCommitToPhysicallyRollback()
-
-