Class LogicalConnectionProvidedImpl
java.lang.Object
org.hibernate.resource.jdbc.internal.AbstractLogicalConnectionImplementor
org.hibernate.resource.jdbc.internal.LogicalConnectionProvidedImpl
- All Implemented Interfaces:
LogicalConnection,LogicalConnectionImplementor,PhysicalJdbcTransaction,JdbcResourceTransaction
-
Field Summary
Fields inherited from class org.hibernate.resource.jdbc.internal.AbstractLogicalConnectionImplementor
resourceRegistry -
Constructor Summary
ConstructorsConstructorDescriptionLogicalConnectionProvidedImpl(Connection providedConnection, ResourceRegistry resourceRegistry) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidclose()Closes the logical connection, making it inactive and forcing release of any held resources.protected ConnectionExposes access to the "real"Connection.booleanisOpen()Is this (logical) JDBC connection still open/active?booleanIs this logical connection currently physically connected?Manually disconnect the underlying JDBC Connection.voidmanualReconnect(Connection connection) Manually reconnect the underlying JDBC Connection.voidSerialization hook.Methods inherited from class org.hibernate.resource.jdbc.internal.AbstractLogicalConnectionImplementor
afterStatement, afterTransaction, beforeTransactionCompletion, begin, commit, determineInitialAutoCommitMode, doConnectionsFromProviderHaveAutoCommitDisabled, errorIfClosed, getPhysicalJdbcTransaction, getResourceRegistry, getStatus, resetConnection, rollback
-
Constructor Details
-
LogicalConnectionProvidedImpl
public LogicalConnectionProvidedImpl(Connection providedConnection, ResourceRegistry resourceRegistry)
-
-
Method Details
-
getConnectionHandlingMode
-
isOpen
public boolean isOpen()Description copied from interface:LogicalConnectionIs this (logical) JDBC connection still open/active?That is, has
LogicalConnection.close()not yet been called?- Returns:
trueif still open, sinceLogicalConnection.close()has not yet been called;falseif not open, sinceLogicalConnection.close()was called.
-
close
Description copied from interface:LogicalConnectionCloses the logical connection, making it inactive and forcing release of any held resources.- Returns:
- the JDBC
Connectionif the user passed in aConnectionoriginally
-
isPhysicallyConnected
public boolean isPhysicallyConnected()Description copied from interface:LogicalConnectionIs this logical connection currently physically connected?That is, does it currently hold a physical JDBC
Connection?- Returns:
trueif currently holding a JDBCConnection;falseif not.
-
getPhysicalConnection
Description copied from interface:LogicalConnectionImplementorExposes access to the "real"Connection.- Returns:
- The connection
-
serialize
Description copied from interface:LogicalConnectionImplementorSerialization hook.- Parameters:
oos- The stream to write out state to- Throws:
IOException- Problem accessing stream
-
deserialize
public static LogicalConnectionProvidedImpl deserialize(ObjectInputStream ois) throws IOException, ClassNotFoundException - Throws:
IOExceptionClassNotFoundException
-
manualDisconnect
Description copied from interface:LogicalConnectionImplementorManually disconnect the underlying JDBC Connection. The assumption here is that the manager will be reconnected at a later point in time.- Returns:
- The connection maintained here at time of disconnect.
nullif there was no connection cached internally.
-
manualReconnect
Description copied from interface:LogicalConnectionImplementorManually reconnect the underlying JDBC Connection. Should be called at some point afterLogicalConnectionImplementor.manualDisconnect().- Parameters:
connection- For user supplied connection strategy the user needs to hand us the connection with which to reconnect. It is an error to pass a connection in the other strategies.
-
getConnectionForTransactionManagement
- Specified by:
getConnectionForTransactionManagementin classAbstractLogicalConnectionImplementor
-
afterCompletion
protected void afterCompletion()- Overrides:
afterCompletionin classAbstractLogicalConnectionImplementor
-