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, waitinvalidatepublic TransactionImpl(TransactionCoordinator transactionCoordinator, ExceptionConverter exceptionConverter, AbstractSharedSessionContract session)
public void begin()
EntityTransactionbegin in interface EntityTransactionpublic void commit()
EntityTransactioncommit in interface EntityTransactionpublic TransactionCoordinator.TransactionDriver internalGetTransactionDriverControl()
public void rollback()
EntityTransactionrollback in interface EntityTransactionpublic boolean isActive()
EntityTransactionisActive in interface EntityTransactionpublic boolean isActive(boolean isMarkedForRollbackConsideredActive)
TransactionImplementorisActive in interface TransactionImplementorisMarkedForRollbackConsideredActive - whether to consider TransactionStatus.MARKED_ROLLBACK as active.public TransactionStatus getStatus()
TransactiongetStatus in interface Transactionpublic void registerSynchronization(Synchronization synchronization) throws HibernateException
TransactionregisterSynchronization in interface Transactionsynchronization - The Synchronization callback to register.HibernateException - Indicates a problem registering the synchronization.public void setTimeout(int seconds)
TransactionEntityTransaction.begin() on this instance.setTimeout in interface Transactionseconds - The number of seconds before a timeout.public int getTimeout()
TransactiongetTimeout in interface Transactionpublic void markRollbackOnly()
TransactionmarkRollbackOnly in interface Transactionpublic void setRollbackOnly()
EntityTransactionsetRollbackOnly in interface EntityTransactionpublic boolean getRollbackOnly()
EntityTransactiongetRollbackOnly in interface EntityTransactionprotected boolean allowFailedCommitToPhysicallyRollback()
Copyright © 2019 JBoss by Red Hat. All rights reserved.