Class AbstractLogicalConnectionImplementor
- java.lang.Object
-
- org.hibernate.resource.jdbc.internal.AbstractLogicalConnectionImplementor
-
- All Implemented Interfaces:
LogicalConnection,LogicalConnectionImplementor,PhysicalJdbcTransaction,JdbcResourceTransaction
- Direct Known Subclasses:
LogicalConnectionManagedImpl,LogicalConnectionProvidedImpl
public abstract class AbstractLogicalConnectionImplementor extends Object implements LogicalConnectionImplementor, PhysicalJdbcTransaction
-
-
Field Summary
Fields Modifier and Type Field Description protected ResourceRegistryresourceRegistry
-
Constructor Summary
Constructors Constructor Description AbstractLogicalConnectionImplementor()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidafterCompletion()voidafterStatement()Notification indicating a JDBC statement has been executed, to triggerConnectionReleaseMode.AFTER_STATEMENTreleasing if needed.voidafterTransaction()Notification indicating a transaction has just completed, to triggerConnectionReleaseMode.AFTER_TRANSACTIONreleasing if needed.voidbeforeTransactionCompletion()Notification indicating a transaction is about to be completed, to trigger release of the JDBC connection if needed, that is, ifConnectionReleaseMode.BEFORE_TRANSACTION_COMPLETIONis enabled.voidbegin()Begin the resource transactionvoidcommit()Commit the resource transactionprotected static booleandetermineInitialAutoCommitMode(Connection providedConnection)protected booleandoConnectionsFromProviderHaveAutoCommitDisabled()protected voiderrorIfClosed()protected abstract ConnectiongetConnectionForTransactionManagement()PhysicalJdbcTransactiongetPhysicalJdbcTransaction()Access to the current underlying JDBC transaction.ResourceRegistrygetResourceRegistry()Provides access to the registry of JDBC resources associated with this logical connection.TransactionStatusgetStatus()protected voidresetConnection(boolean initiallyAutoCommit)voidrollback()Rollback the resource transaction-
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.jdbc.LogicalConnection
close, isOpen, isPhysicallyConnected
-
Methods inherited from interface org.hibernate.resource.jdbc.spi.LogicalConnectionImplementor
getConnectionHandlingMode, getPhysicalConnection, manualDisconnect, manualReconnect, serialize
-
-
-
-
Field Detail
-
resourceRegistry
protected ResourceRegistry resourceRegistry
-
-
Method Detail
-
getPhysicalJdbcTransaction
public PhysicalJdbcTransaction getPhysicalJdbcTransaction()
Description copied from interface:LogicalConnectionImplementorAccess to the current underlying JDBC transaction.- Specified by:
getPhysicalJdbcTransactionin interfaceLogicalConnectionImplementor
-
errorIfClosed
protected void errorIfClosed()
-
getResourceRegistry
public ResourceRegistry getResourceRegistry()
Description copied from interface:LogicalConnectionProvides access to the registry of JDBC resources associated with this logical connection.- Specified by:
getResourceRegistryin interfaceLogicalConnection- Returns:
- The JDBC resource registry.
-
afterStatement
public void afterStatement()
Description copied from interface:LogicalConnectionImplementorNotification indicating a JDBC statement has been executed, to triggerConnectionReleaseMode.AFTER_STATEMENTreleasing if needed.- Specified by:
afterStatementin interfaceLogicalConnectionImplementor
-
beforeTransactionCompletion
public void beforeTransactionCompletion()
Description copied from interface:LogicalConnectionImplementorNotification indicating a transaction is about to be completed, to trigger release of the JDBC connection if needed, that is, ifConnectionReleaseMode.BEFORE_TRANSACTION_COMPLETIONis enabled.- Specified by:
beforeTransactionCompletionin interfaceLogicalConnectionImplementor
-
afterTransaction
public void afterTransaction()
Description copied from interface:LogicalConnectionImplementorNotification indicating a transaction has just completed, to triggerConnectionReleaseMode.AFTER_TRANSACTIONreleasing if needed.- Specified by:
afterTransactionin interfaceLogicalConnectionImplementor
-
getConnectionForTransactionManagement
protected abstract Connection getConnectionForTransactionManagement()
-
begin
public void begin()
Description copied from interface:JdbcResourceTransactionBegin the resource transaction- Specified by:
beginin interfaceJdbcResourceTransaction
-
commit
public void commit()
Description copied from interface:JdbcResourceTransactionCommit the resource transaction- Specified by:
commitin interfaceJdbcResourceTransaction
-
afterCompletion
protected void afterCompletion()
-
resetConnection
protected void resetConnection(boolean initiallyAutoCommit)
-
rollback
public void rollback()
Description copied from interface:JdbcResourceTransactionRollback the resource transaction- Specified by:
rollbackin interfaceJdbcResourceTransaction
-
determineInitialAutoCommitMode
protected static boolean determineInitialAutoCommitMode(Connection providedConnection)
-
getStatus
public TransactionStatus getStatus()
- Specified by:
getStatusin interfaceJdbcResourceTransaction
-
doConnectionsFromProviderHaveAutoCommitDisabled
protected boolean doConnectionsFromProviderHaveAutoCommitDisabled()
-
-