Class JdbcResourceLocalTransactionCoordinatorImpl
- java.lang.Object
-
- org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl
-
- All Implemented Interfaces:
TransactionCoordinator
public class JdbcResourceLocalTransactionCoordinatorImpl extends Object implements TransactionCoordinator
An implementation of TransactionCoordinator based on managing a transaction through the JDBC Connection viaJdbcResourceTransaction- See Also:
JdbcResourceTransaction
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classJdbcResourceLocalTransactionCoordinatorImpl.TransactionDriverControlImplThe delegate bridging between the local (application facing) transaction and the "physical" notion of a transaction via the JDBC Connection.-
Nested classes/interfaces inherited from interface org.hibernate.resource.transaction.spi.TransactionCoordinator
TransactionCoordinator.TransactionDriver
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 transactionbooleanisActive()Is this transaction still active?booleanisJoined()Determine if there is an active transaction that this coordinator is already joined to.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)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.hibernate.resource.transaction.spi.TransactionCoordinator
invalidate, isTransactionActive, isTransactionActive
-
-
-
-
Method Detail
-
getTransactionDriverControl
public TransactionCoordinator.TransactionDriver getTransactionDriverControl()
Description copied from interface:TransactionCoordinatorGet the delegate used by the local transaction driver to control the underlying transaction- Specified by:
getTransactionDriverControlin interfaceTransactionCoordinator- Returns:
- The control delegate.
-
explicitJoin
public void explicitJoin()
Description copied from interface:TransactionCoordinatorIndicates 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- Specified by:
explicitJoinin interfaceTransactionCoordinator
-
isJoined
public boolean isJoined()
Description copied from interface:TransactionCoordinatorDetermine if there is an active transaction that this coordinator is already joined to.- Specified by:
isJoinedin interfaceTransactionCoordinator- Returns:
trueif there is an active transaction this coordinator is already joined to;falseotherwise.
-
pulse
public void pulse()
Description copied from interface:TransactionCoordinatorUsed by owner of the JdbcSession as a means to indicate that implicit joining should be done if needed.- Specified by:
pulsein interfaceTransactionCoordinator
-
getLocalSynchronizations
public SynchronizationRegistry getLocalSynchronizations()
Description copied from interface:TransactionCoordinatorGet access to the local registry of Synchronization instances- Specified by:
getLocalSynchronizationsin interfaceTransactionCoordinator- Returns:
- The local Synchronization registry
-
getJpaCompliance
public JpaCompliance getJpaCompliance()
- Specified by:
getJpaCompliancein interfaceTransactionCoordinator
-
isActive
public boolean isActive()
Description copied from interface:TransactionCoordinatorIs 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 JDBC
Connection, only when it is initiated from here.- Specified by:
isActivein interfaceTransactionCoordinator- Returns:
trueif the transaction is still active;falseotherwise.
-
createIsolationDelegate
public IsolationDelegate createIsolationDelegate()
Description copied from interface:TransactionCoordinatorRetrieve an isolation delegate appropriate for this transaction strategy.- Specified by:
createIsolationDelegatein interfaceTransactionCoordinator- Returns:
- An isolation delegate.
-
getTransactionCoordinatorBuilder
public TransactionCoordinatorBuilder getTransactionCoordinatorBuilder()
Description copied from interface:TransactionCoordinatorAccess to the builder that generated this coordinator- Specified by:
getTransactionCoordinatorBuilderin interfaceTransactionCoordinator
-
setTimeOut
public void setTimeOut(int seconds)
- Specified by:
setTimeOutin interfaceTransactionCoordinator
-
getTimeOut
public int getTimeOut()
- Specified by:
getTimeOutin interfaceTransactionCoordinator
-
addObserver
public void addObserver(TransactionObserver observer)
Description copied from interface:TransactionCoordinatorAdds an observer to the coordinator.observers are not to be cleared on transaction completion.
- Specified by:
addObserverin interfaceTransactionCoordinator- Parameters:
observer- The observer to add.
-
removeObserver
public void removeObserver(TransactionObserver observer)
Description copied from interface:TransactionCoordinatorRemoved an observer from the coordinator.- Specified by:
removeObserverin interfaceTransactionCoordinator- Parameters:
observer- The observer to remove.
-
-