Top Description Inners Fields Constructors Methods
org.hibernate.resource.transaction.backend.jdbc.internal

public Class JdbcResourceLocalTransactionCoordinatorImpl

extends Object
implements TransactionCoordinator
Class Inheritance
All Implemented Interfaces
org.hibernate.resource.transaction.spi.TransactionCoordinator
Imports
java.util.ArrayList, .Collections, .List, javax.persistence.RollbackException, javax.transaction.Status, org.hibernate.engine.jdbc.spi.JdbcServices, org.hibernate.engine.transaction.spi.IsolationDelegate, .TransactionObserver, org.hibernate.internal.CoreMessageLogger, org.hibernate.jpa.spi.JpaCompliance, org.hibernate.resource.jdbc.spi.JdbcSessionOwner, org.hibernate.resource.transaction.backend.jdbc.spi.JdbcResourceTransaction, .JdbcResourceTransactionAccess, org.hibernate.resource.transaction.internal.SynchronizationRegistryStandardImpl, org.hibernate.resource.transaction.spi.SynchronizationRegistry, .TransactionCoordinator, .TransactionCoordinatorBuilder, .TransactionCoordinatorOwner, .TransactionStatus

An implementation of TransactionCoordinator based on managing a transaction through the JDBC Connection via org.hibernate.resource.transaction.backend.jdbc.spi.JdbcResourceTransaction
Author
Steve Ebersole
See Also
org.hibernate.resource.transaction.backend.jdbc.spi.JdbcResourceTransaction

Nested and Inner Type Summary

Modifier and TypeClass and Description
public class
JdbcResourceLocalTransactionCoordinatorImpl.TransactionDriverControlImpl

The delegate bridging between the local (application facing) transaction and the "physical" notion of a transaction via the JDBC Connection.

Field Summary

Modifier and TypeField and Description
private final JdbcResourceTransactionAccess
private final JpaCompliance
private static final CoreMessageLogger
private transient List<TransactionObserver>
private JdbcResourceLocalTransactionCoordinatorImpl.TransactionDriverControlImpl
private final SynchronizationRegistryStandardImpl
private int
private final TransactionCoordinatorBuilder
private final TransactionCoordinatorOwner

Constructor Summary

AccessConstructor and Description
pack-priv
JdbcResourceLocalTransactionCoordinatorImpl(TransactionCoordinatorBuilder transactionCoordinatorBuilder, TransactionCoordinatorOwner
The transactionCoordinatorOwner
owner
,
JdbcResourceTransactionAccess jdbcResourceTransactionAccess)

Construct a ResourceLocalTransactionCoordinatorImpl instance.

Method Summary

Modifier and TypeMethod and Description
public void
addObserver(TransactionObserver
The observer to add.
observer
)

Implements org.hibernate.resource.transaction.spi.TransactionCoordinator.addObserver.

Adds an observer to the coordinator.
private void
private void
afterCompletionCallback(boolean successful)

private void
public IsolationDelegate
createIsolationDelegate()

Implements org.hibernate.resource.transaction.spi.TransactionCoordinator.createIsolationDelegate.

Retrieve an isolation delegate appropriate for this transaction strategy.
public void
explicitJoin()

Implements org.hibernate.resource.transaction.spi.TransactionCoordinator.explicitJoin.

Indicates an explicit request to join a transaction.
public JpaCompliance
public SynchronizationRegistry
getLocalSynchronizations()

Implements org.hibernate.resource.transaction.spi.TransactionCoordinator.getLocalSynchronizations.

Get access to the local registry of Synchronization instances
public int
public TransactionCoordinatorBuilder
public TransactionCoordinator.TransactionDriver
getTransactionDriverControl()

Implements org.hibernate.resource.transaction.spi.TransactionCoordinator.getTransactionDriverControl.

Get the delegate used by the local transaction driver to control the underlying transaction
public boolean
public boolean
isJoined()

Implements org.hibernate.resource.transaction.spi.TransactionCoordinator.isJoined.

Determine if there is an active transaction that this coordinator is already joined to.
private Iterable<TransactionObserver>

Returns:

TransactionObserver
observers
()

Needed because while iterating the observers list and executing the before/update callbacks, some observers might get removed from the list.

public void
pulse()

Implements org.hibernate.resource.transaction.spi.TransactionCoordinator.pulse.

Used by owner of the JdbcSession as a means to indicate that implicit joining should be done if needed.
public void
removeObserver(TransactionObserver
The observer to remove.
observer
)

Implements org.hibernate.resource.transaction.spi.TransactionCoordinator.removeObserver.

Removed an observer from the coordinator.
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

jdbcResourceTransactionAccessback to summary
private final JdbcResourceTransactionAccess jdbcResourceTransactionAccess
jpaComplianceback to summary
private final JpaCompliance jpaCompliance
logback to summary
private static final CoreMessageLogger log
observersback to summary
private transient List<TransactionObserver> observers
physicalTransactionDelegateback to summary
private JdbcResourceLocalTransactionCoordinatorImpl.TransactionDriverControlImpl physicalTransactionDelegate
synchronizationRegistryback to summary
private final SynchronizationRegistryStandardImpl synchronizationRegistry
timeOutback to summary
private int timeOut
transactionCoordinatorBuilderback to summary
private final TransactionCoordinatorBuilder transactionCoordinatorBuilder
transactionCoordinatorOwnerback to summary
private final TransactionCoordinatorOwner transactionCoordinatorOwner

Constructor Detail

JdbcResourceLocalTransactionCoordinatorImplback to summary
pack-priv JdbcResourceLocalTransactionCoordinatorImpl(TransactionCoordinatorBuilder transactionCoordinatorBuilder, TransactionCoordinatorOwner owner, JdbcResourceTransactionAccess jdbcResourceTransactionAccess)

Construct a ResourceLocalTransactionCoordinatorImpl instance. package-protected to ensure access goes through builder.

Parameters
owner:TransactionCoordinatorOwner

The transactionCoordinatorOwner

Method Detail

addObserverback to summary
public void addObserver(TransactionObserver observer)

Implements org.hibernate.resource.transaction.spi.TransactionCoordinator.addObserver.

Doc from org.hibernate.resource.transaction.spi.TransactionCoordinator.addObserver.

Adds an observer to the coordinator.

observers are not to be cleared on transaction completion.

Parameters
observer:TransactionObserver

The observer to add.

Annotations
@Override
afterBeginCallbackback to summary
private void afterBeginCallback()
afterCompletionCallbackback to summary
private void afterCompletionCallback(boolean successful)
beforeCompletionCallbackback to summary
private void beforeCompletionCallback()
createIsolationDelegateback to summary
public IsolationDelegate createIsolationDelegate()

Implements org.hibernate.resource.transaction.spi.TransactionCoordinator.createIsolationDelegate.

Doc from org.hibernate.resource.transaction.spi.TransactionCoordinator.createIsolationDelegate.

Retrieve an isolation delegate appropriate for this transaction strategy.

Returns:IsolationDelegate

An isolation delegate.

Annotations
@Override
explicitJoinback to summary
public void explicitJoin()

Implements org.hibernate.resource.transaction.spi.TransactionCoordinator.explicitJoin.

Doc from org.hibernate.resource.transaction.spi.TransactionCoordinator.explicitJoin.

Indicates an explicit request to join a transaction. This is mainly intended to handle the JPA requirement around javax.persistence.EntityManager#joinTransaction(), and generally speaking only has an impact in JTA environments

Annotations
@Override
getJpaComplianceback to summary
public JpaCompliance getJpaCompliance()

Implements org.hibernate.resource.transaction.spi.TransactionCoordinator.getJpaCompliance.

Annotations
@Override
getLocalSynchronizationsback to summary
public SynchronizationRegistry getLocalSynchronizations()

Implements org.hibernate.resource.transaction.spi.TransactionCoordinator.getLocalSynchronizations.

Doc from org.hibernate.resource.transaction.spi.TransactionCoordinator.getLocalSynchronizations.

Get access to the local registry of Synchronization instances

Returns:SynchronizationRegistry

The local Synchronization registry

Annotations
@Override
getTimeOutback to summary
public int getTimeOut()

Implements org.hibernate.resource.transaction.spi.TransactionCoordinator.getTimeOut.

Annotations
@Override
getTransactionCoordinatorBuilderback to summary
public TransactionCoordinatorBuilder getTransactionCoordinatorBuilder()

Implements org.hibernate.resource.transaction.spi.TransactionCoordinator.getTransactionCoordinatorBuilder.

Doc from org.hibernate.resource.transaction.spi.TransactionCoordinator.getTransactionCoordinatorBuilder.

Access to the builder that generated this coordinator

Annotations
@Override
getTransactionDriverControlback to summary
public TransactionCoordinator.TransactionDriver getTransactionDriverControl()

Implements org.hibernate.resource.transaction.spi.TransactionCoordinator.getTransactionDriverControl.

Doc from org.hibernate.resource.transaction.spi.TransactionCoordinator.getTransactionDriverControl.

Get the delegate used by the local transaction driver to control the underlying transaction

Returns:TransactionCoordinator.TransactionDriver

The control delegate.

Annotations
@Override
isActiveback to summary
public boolean isActive()

Implements org.hibernate.resource.transaction.spi.TransactionCoordinator.isActive.

Doc from org.hibernate.resource.transaction.spi.TransactionCoordinator.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 JDBC java.sql.Connection, only when it is initiated from here.

Returns:boolean

true if the transaction is still active; false otherwise.

Annotations
@Override
isJoinedback to summary
public boolean isJoined()

Implements org.hibernate.resource.transaction.spi.TransactionCoordinator.isJoined.

Doc from org.hibernate.resource.transaction.spi.TransactionCoordinator.isJoined.

Determine if there is an active transaction that this coordinator is already joined to.

Returns:boolean

true if there is an active transaction this coordinator is already joined to; false otherwise.

Annotations
@Override
observersback to summary
private Iterable<TransactionObserver> observers()

Needed because while iterating the observers list and executing the before/update callbacks, some observers might get removed from the list.

Returns:Iterable<TransactionObserver>

TransactionObserver

pulseback to summary
public void pulse()

Implements org.hibernate.resource.transaction.spi.TransactionCoordinator.pulse.

Doc from org.hibernate.resource.transaction.spi.TransactionCoordinator.pulse.

Used by owner of the JdbcSession as a means to indicate that implicit joining should be done if needed.

Annotations
@Override
removeObserverback to summary
public void removeObserver(TransactionObserver observer)

Implements org.hibernate.resource.transaction.spi.TransactionCoordinator.removeObserver.

Doc from org.hibernate.resource.transaction.spi.TransactionCoordinator.removeObserver.

Removed an observer from the coordinator.

Parameters
observer:TransactionObserver

The observer to remove.

Annotations
@Override
setTimeOutback to summary
public void setTimeOut(int seconds)

Implements org.hibernate.resource.transaction.spi.TransactionCoordinator.setTimeOut.

Annotations
@Override
org.hibernate.resource.transaction.backend.jdbc.internal back to summary

public Class JdbcResourceLocalTransactionCoordinatorImpl.TransactionDriverControlImpl

extends Object
implements TransactionDriver
Class Inheritance
  • java.lang.Object
  • org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl.TransactionDriverControlImpl
All Implemented Interfaces
org.hibernate.resource.transaction.spi.TransactionCoordinator.TransactionDriver

The delegate bridging between the local (application facing) transaction and the "physical" notion of a transaction via the JDBC Connection.

Field Summary

Modifier and TypeField and Description
private boolean
private final JdbcResourceTransaction
private boolean

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
public void
protected void
public TransactionStatus
protected void
public void
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

invalidback to summary
private boolean invalid
jdbcResourceTransactionback to summary
private final JdbcResourceTransaction jdbcResourceTransaction
rollbackOnlyback to summary
private boolean rollbackOnly

Constructor Detail

TransactionDriverControlImplback to summary
public TransactionDriverControlImpl(JdbcResourceTransaction jdbcResourceTransaction)

Method Detail

beginback to summary
public void begin()

Implements org.hibernate.resource.transaction.spi.TransactionCoordinator.TransactionDriver.begin.

Doc from org.hibernate.resource.transaction.spi.TransactionCoordinator.TransactionDriver.begin.

Begin the physical transaction

Annotations
@Override
commitback to summary
public void commit()

Implements org.hibernate.resource.transaction.spi.TransactionCoordinator.TransactionDriver.commit.

Doc from org.hibernate.resource.transaction.spi.TransactionCoordinator.TransactionDriver.commit.

Commit the physical transaction

Annotations
@Override
errorIfInvalidback to summary
protected void errorIfInvalid()
getStatusback to summary
public TransactionStatus getStatus()

Implements org.hibernate.resource.transaction.spi.TransactionCoordinator.TransactionDriver.getStatus.

Annotations
@Override
invalidateback to summary
protected void invalidate()
markRollbackOnlyback to summary
public void markRollbackOnly()

Implements org.hibernate.resource.transaction.spi.TransactionCoordinator.TransactionDriver.markRollbackOnly.

Annotations
@Override
rollbackback to summary
public void rollback()

Implements org.hibernate.resource.transaction.spi.TransactionCoordinator.TransactionDriver.rollback.

Doc from org.hibernate.resource.transaction.spi.TransactionCoordinator.TransactionDriver.rollback.

Rollback the physical transaction

Annotations
@Override