public class TransactionImpl extends Object implements TransactionImplementor
Constructor and Description |
---|
TransactionImpl(TransactionCoordinator transactionCoordinator,
ExceptionConverter exceptionConverter,
AbstractSharedSessionContract session) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
allowFailedCommitToPhysicallyRollback() |
void |
begin()
Start a resource transaction.
|
void |
commit()
Commit the current resource transaction, writing any
unflushed changes to the database.
|
boolean |
getRollbackOnly()
Determine whether the current resource transaction has been
marked for rollback.
|
TransactionStatus |
getStatus()
Get the current local status of this transaction.
|
int |
getTimeout()
Retrieve the transaction timeout set for this transaction.
|
TransactionCoordinator.TransactionDriver |
internalGetTransactionDriverControl() |
boolean |
isActive()
Indicate whether a resource transaction is in progress.
|
boolean |
isActive(boolean isMarkedForRollbackConsideredActive)
Indicate whether a resource transaction is in progress.
|
void |
markRollbackOnly()
Make a best effort to mark the underlying transaction for rollback only.
|
void |
registerSynchronization(Synchronization synchronization)
Register a user synchronization callback for this transaction.
|
void |
rollback()
Roll back the current resource transaction.
|
void |
setRollbackOnly()
Mark the current resource transaction so that the only
possible outcome of the transaction is for the transaction
to be rolled back.
|
void |
setTimeout(int seconds)
Set the transaction timeout for any transaction started by a subsequent call to
EntityTransaction.begin() on this instance. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
invalidate
public TransactionImpl(TransactionCoordinator transactionCoordinator, ExceptionConverter exceptionConverter, AbstractSharedSessionContract session)
public void begin()
EntityTransaction
begin
in interface EntityTransaction
public void commit()
EntityTransaction
commit
in interface EntityTransaction
public TransactionCoordinator.TransactionDriver internalGetTransactionDriverControl()
public void rollback()
EntityTransaction
rollback
in interface EntityTransaction
public boolean isActive()
EntityTransaction
isActive
in interface EntityTransaction
public boolean isActive(boolean isMarkedForRollbackConsideredActive)
TransactionImplementor
isActive
in interface TransactionImplementor
isMarkedForRollbackConsideredActive
- whether to consider TransactionStatus.MARKED_ROLLBACK
as active.public TransactionStatus getStatus()
Transaction
getStatus
in interface Transaction
public void registerSynchronization(Synchronization synchronization) throws HibernateException
Transaction
registerSynchronization
in interface Transaction
synchronization
- The Synchronization callback to register.HibernateException
- Indicates a problem registering the synchronization.public void setTimeout(int seconds)
Transaction
EntityTransaction.begin()
on this instance.setTimeout
in interface Transaction
seconds
- The number of seconds before a timeout.public int getTimeout()
Transaction
getTimeout
in interface Transaction
public void markRollbackOnly()
Transaction
markRollbackOnly
in interface Transaction
public void setRollbackOnly()
EntityTransaction
setRollbackOnly
in interface EntityTransaction
public boolean getRollbackOnly()
EntityTransaction
getRollbackOnly
in interface EntityTransaction
protected boolean allowFailedCommitToPhysicallyRollback()
Copyright © 2019 JBoss by Red Hat. All rights reserved.