接口 TransactionCoordinator
-
public interface TransactionCoordinatorModels the coordination of all transaction related flows.- 作者:
- Steve Ebersole
-
-
嵌套类概要
嵌套类 修饰符和类型 接口 说明 static interfaceTransactionCoordinator.TransactionDriverProvides the means for "local transactions" (as transaction drivers) to control the underlying "physical transaction" currently associated with the TransactionCoordinator.
-
方法概要
所有方法 实例方法 抽象方法 默认方法 修饰符和类型 方法 说明 voidaddObserver(TransactionObserver observer)Adds an observer to the coordinator.IsolationDelegatecreateIsolationDelegate()Retrieve an isolation delegate appropriate for this transaction strategy.voidexplicitJoin()Indicates an explicit request to join a transaction.JpaCompliancegetJpaCompliance()SynchronizationRegistrygetLocalSynchronizations()Get access to the local registry of Synchronization instancesintgetTimeOut()TransactionCoordinatorBuildergetTransactionCoordinatorBuilder()Access to the builder that generated this coordinatorTransactionCoordinator.TransactionDrivergetTransactionDriverControl()Get the delegate used by the local transaction driver to control the underlying transactiondefault voidinvalidate()booleanisActive()Is this transaction still active?booleanisJoined()Determine if there is an active transaction that this coordinator is already joined to.default booleanisTransactionActive()default booleanisTransactionActive(boolean isMarkedRollbackConsideredActive)voidpulse()Used by owner of the JdbcSession as a means to indicate that implicit joining should be done if needed.voidremoveObserver(TransactionObserver observer)Removed an observer from the coordinator.voidsetTimeOut(int seconds)
-
-
-
方法详细资料
-
getTransactionCoordinatorBuilder
TransactionCoordinatorBuilder getTransactionCoordinatorBuilder()
Access to the builder that generated this coordinator
-
getTransactionDriverControl
TransactionCoordinator.TransactionDriver getTransactionDriverControl()
Get the delegate used by the local transaction driver to control the underlying transaction- 返回:
- The control delegate.
-
getLocalSynchronizations
SynchronizationRegistry getLocalSynchronizations()
Get access to the local registry of Synchronization instances- 返回:
- The local Synchronization registry
-
getJpaCompliance
JpaCompliance getJpaCompliance()
-
explicitJoin
void explicitJoin()
Indicates an explicit request to join a transaction. This is mainly intended to handle the JPA requirement aroundEntityManager.joinTransaction(), and generally speaking only has an impact in JTA environments
-
isJoined
boolean isJoined()
Determine if there is an active transaction that this coordinator is already joined to.- 返回:
trueif there is an active transaction this coordinator is already joined to;falseotherwise.
-
pulse
void pulse()
Used by owner of the JdbcSession as a means to indicate that implicit joining should be done if needed.
-
isActive
boolean isActive()
Is this transaction still active? Answers on a best effort basis. For example, in the case of JDBC based transactions we cannot know that a transaction is active when it is initiated directly through the JDBCConnection, only when it is initiated from here.- 返回:
trueif the transaction is still active;falseotherwise.- 抛出:
HibernateException- Indicates a problem checking the transaction status.
-
createIsolationDelegate
IsolationDelegate createIsolationDelegate()
Retrieve an isolation delegate appropriate for this transaction strategy.- 返回:
- An isolation delegate.
-
addObserver
void addObserver(TransactionObserver observer)
Adds an observer to the coordinator. observers are not to be cleared on transaction completion.- 参数:
observer- The observer to add.
-
removeObserver
void removeObserver(TransactionObserver observer)
Removed an observer from the coordinator.- 参数:
observer- The observer to remove.
-
setTimeOut
void setTimeOut(int seconds)
-
getTimeOut
int getTimeOut()
-
isTransactionActive
default boolean isTransactionActive()
-
isTransactionActive
default boolean isTransactionActive(boolean isMarkedRollbackConsideredActive)
-
invalidate
default void invalidate()
-
-