类 TransactionImpl
- java.lang.Object
-
- org.hibernate.engine.transaction.internal.TransactionImpl
-
- 所有已实现的接口:
javax.persistence.EntityTransaction,TransactionImplementor,Transaction
public class TransactionImpl extends Object implements TransactionImplementor
- 作者:
- Andrea Boriero, Steve Ebersole
-
-
构造器概要
构造器 构造器 说明 TransactionImpl(TransactionCoordinator transactionCoordinator, AbstractSharedSessionContract session)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected booleanallowFailedCommitToPhysicallyRollback()voidbegin()voidcommit()booleangetRollbackOnly()TransactionStatusgetStatus()Get the current local status of this transaction.intgetTimeout()Retrieve the transaction timeout set for this transaction.TransactionCoordinator.TransactionDriverinternalGetTransactionDriverControl()booleanisActive()booleanisActive(boolean isMarkedForRollbackConsideredActive)Indicate whether a resource transaction is in progress.voidmarkRollbackOnly()Make a best effort to mark the underlying transaction for rollback only.voidregisterSynchronization(javax.transaction.Synchronization synchronization)Register a user synchronization callback for this transaction.voidrollback()voidsetRollbackOnly()voidsetTimeout(int seconds)Set the transaction timeout for any transaction started by a subsequent call toEntityTransaction.begin()on this instance.-
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
从接口继承的方法 org.hibernate.engine.transaction.spi.TransactionImplementor
invalidate
-
-
-
-
构造器详细资料
-
TransactionImpl
public TransactionImpl(TransactionCoordinator transactionCoordinator, AbstractSharedSessionContract session)
-
-
方法详细资料
-
begin
public void begin()
- 指定者:
begin在接口中javax.persistence.EntityTransaction
-
commit
public void commit()
- 指定者:
commit在接口中javax.persistence.EntityTransaction
-
internalGetTransactionDriverControl
public TransactionCoordinator.TransactionDriver internalGetTransactionDriverControl()
-
rollback
public void rollback()
- 指定者:
rollback在接口中javax.persistence.EntityTransaction
-
isActive
public boolean isActive()
- 指定者:
isActive在接口中javax.persistence.EntityTransaction
-
isActive
public boolean isActive(boolean isMarkedForRollbackConsideredActive)
从接口复制的说明:TransactionImplementorIndicate whether a resource transaction is in progress.- 指定者:
isActive在接口中TransactionImplementor- 参数:
isMarkedForRollbackConsideredActive- whether to considerTransactionStatus.MARKED_ROLLBACKas active.- 返回:
- boolean indicating whether transaction is in progress
-
getStatus
public TransactionStatus getStatus()
从接口复制的说明:TransactionGet the current local status of this transaction. This only accounts for the local view of the transaction status. In other words it does not check the status of the actual underlying transaction.- 指定者:
getStatus在接口中Transaction- 返回:
- The current local status.
-
registerSynchronization
public void registerSynchronization(javax.transaction.Synchronization synchronization) throws HibernateException从接口复制的说明:TransactionRegister a user synchronization callback for this transaction.- 指定者:
registerSynchronization在接口中Transaction- 参数:
synchronization- The Synchronization callback to register.- 抛出:
HibernateException- Indicates a problem registering the synchronization.
-
setTimeout
public void setTimeout(int seconds)
从接口复制的说明:TransactionSet the transaction timeout for any transaction started by a subsequent call toEntityTransaction.begin()on this instance.- 指定者:
setTimeout在接口中Transaction- 参数:
seconds- The number of seconds before a timeout.
-
getTimeout
public int getTimeout()
从接口复制的说明:TransactionRetrieve the transaction timeout set for this transaction. A negative indicates no timeout has been set.- 指定者:
getTimeout在接口中Transaction- 返回:
- The timeout, in seconds.
-
markRollbackOnly
public void markRollbackOnly()
从接口复制的说明:TransactionMake a best effort to mark the underlying transaction for rollback only.- 指定者:
markRollbackOnly在接口中Transaction
-
setRollbackOnly
public void setRollbackOnly()
- 指定者:
setRollbackOnly在接口中javax.persistence.EntityTransaction
-
getRollbackOnly
public boolean getRollbackOnly()
- 指定者:
getRollbackOnly在接口中javax.persistence.EntityTransaction
-
allowFailedCommitToPhysicallyRollback
protected boolean allowFailedCommitToPhysicallyRollback()
-
-