Top Fields Constructors Methods
org.hibernate.resource.jdbc.internal

public Class LogicalConnectionProvidedImpl

extends AbstractLogicalConnectionImplementor
Class Inheritance
Imports
java.io.IOException, .ObjectInputStream, .ObjectOutputStream, java.sql.Connection, org.hibernate.resource.jdbc.LogicalConnection, .ResourceRegistry, org.hibernate.resource.jdbc.spi.LogicalConnectionImplementor, .PhysicalConnectionHandlingMode, org.jboss.logging.Logger

Author
Steve Ebersole

Field Summary

Modifier and TypeField and Description
private boolean
private final boolean
private static final Logger
private transient Connection
Inherited from org.hibernate.resource.jdbc.internal.AbstractLogicalConnectionImplementor:
resourceRegistry

Constructor Summary

AccessConstructor and Description
public
LogicalConnectionProvidedImpl(Connection providedConnection, ResourceRegistry resourceRegistry)

private
LogicalConnectionProvidedImpl(boolean closed, boolean initiallyAutoCommit)

Method Summary

Modifier and TypeMethod and Description
protected void
public Connection
close()

Implements org.hibernate.resource.jdbc.LogicalConnection.close.

Closes the JdbcSession, making it inactive and forcing release of any held resources
public static LogicalConnectionProvidedImpl
protected Connection
public PhysicalConnectionHandlingMode
public Connection
public boolean
isOpen()

Implements org.hibernate.resource.jdbc.LogicalConnection.isOpen.

Is this (logical) JDBC Connection still open/active.
public boolean
isPhysicallyConnected()

Implements org.hibernate.resource.jdbc.LogicalConnection.isPhysicallyConnected.

Is this JdbcSession currently physically connected (meaning does it currently hold a JDBC Connection)?
public LogicalConnectionImplementor
makeShareableCopy()

Implements org.hibernate.resource.jdbc.spi.LogicalConnectionImplementor.makeShareableCopy.

Creates a shareable copy of itself for use in "shared sessions"
public Connection
manualDisconnect()

Implements org.hibernate.resource.jdbc.spi.LogicalConnectionImplementor.manualDisconnect.

Manually disconnect the underlying JDBC Connection.
public void
manualReconnect(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.
connection
)

Implements org.hibernate.resource.jdbc.spi.LogicalConnectionImplementor.manualReconnect.

Manually reconnect the underlying JDBC Connection.
public void
serialize(ObjectOutputStream
The stream to write out state to
oos
)

Implements org.hibernate.resource.jdbc.spi.LogicalConnectionImplementor.serialize.

Serialization hook
Inherited from org.hibernate.resource.jdbc.internal.AbstractLogicalConnectionImplementor:
afterStatementafterTransactionbeforeTransactionCompletionbegincommitdetermineInitialAutoCommitModedoConnectionsFromProviderHaveAutoCommitDisablederrorIfClosedgetPhysicalJdbcTransactiongetResourceRegistrygetStatusresetConnectionrollback

Field Detail

closedback to summary
private boolean closed
initiallyAutoCommitback to summary
private final boolean initiallyAutoCommit
logback to summary
private static final Logger log

Hides org.hibernate.resource.jdbc.internal.AbstractLogicalConnectionImplementor.log.

providedConnectionback to summary
private transient Connection providedConnection

Constructor Detail

LogicalConnectionProvidedImplback to summary
public LogicalConnectionProvidedImpl(Connection providedConnection, ResourceRegistry resourceRegistry)
LogicalConnectionProvidedImplback to summary
private LogicalConnectionProvidedImpl(boolean closed, boolean initiallyAutoCommit)

Method Detail

afterCompletionback to summary
protected void afterCompletion()

Overrides org.hibernate.resource.jdbc.internal.AbstractLogicalConnectionImplementor.afterCompletion.

Annotations
@Override
closeback to summary
public Connection close()

Implements org.hibernate.resource.jdbc.LogicalConnection.close.

Doc from org.hibernate.resource.jdbc.LogicalConnection.close.

Closes the JdbcSession, making it inactive and forcing release of any held resources

Returns:Connection

Legacy :( Returns the JDBC Connection *if* the user passed in a Connection originally.

Annotations
@Override
deserializeback to summary
public static LogicalConnectionProvidedImpl deserialize(ObjectInputStream ois) throws IOException, ClassNotFoundException
getConnectionForTransactionManagementback to summary
protected Connection getConnectionForTransactionManagement()

Implements abstract org.hibernate.resource.jdbc.internal.AbstractLogicalConnectionImplementor.getConnectionForTransactionManagement.

Annotations
@Override
getConnectionHandlingModeback to summary
public PhysicalConnectionHandlingMode getConnectionHandlingMode()

Implements org.hibernate.resource.jdbc.spi.LogicalConnectionImplementor.getConnectionHandlingMode.

Annotations
@Override
getPhysicalConnectionback to summary
public Connection getPhysicalConnection()

Implements org.hibernate.resource.jdbc.spi.LogicalConnectionImplementor.getPhysicalConnection.

Doc from org.hibernate.resource.jdbc.spi.LogicalConnectionImplementor.getPhysicalConnection.

Exposes access to the "real" Connection.

Returns:Connection

The connection

Annotations
@Override
isOpenback to summary
public boolean isOpen()

Implements org.hibernate.resource.jdbc.LogicalConnection.isOpen.

Doc from org.hibernate.resource.jdbc.LogicalConnection.isOpen.

Is this (logical) JDBC Connection still open/active. In other words, has close not been called yet?

Returns:boolean

true if still open (close has not been called yet); false if not open (close has been called).

Annotations
@Override
isPhysicallyConnectedback to summary
public boolean isPhysicallyConnected()

Implements org.hibernate.resource.jdbc.LogicalConnection.isPhysicallyConnected.

Doc from org.hibernate.resource.jdbc.LogicalConnection.isPhysicallyConnected.

Is this JdbcSession currently physically connected (meaning does it currently hold a JDBC Connection)?

Returns:boolean

true if the JdbcSession currently hold a JDBC Connection; false if it does not.

Annotations
@Override
makeShareableCopyback to summary
public LogicalConnectionImplementor makeShareableCopy()

Implements org.hibernate.resource.jdbc.spi.LogicalConnectionImplementor.makeShareableCopy.

Doc from org.hibernate.resource.jdbc.spi.LogicalConnectionImplementor.makeShareableCopy.

Creates a shareable copy of itself for use in "shared sessions"

Returns:LogicalConnectionImplementor

The shareable copy.

Annotations
@Override
manualDisconnectback to summary
public Connection manualDisconnect()

Implements org.hibernate.resource.jdbc.spi.LogicalConnectionImplementor.manualDisconnect.

Doc from org.hibernate.resource.jdbc.spi.LogicalConnectionImplementor.manualDisconnect.

Manually disconnect the underlying JDBC Connection. The assumption here is that the manager will be reconnected at a later point in time.

Returns:Connection

The connection maintained here at time of disconnect. null if there was no connection cached internally.

Annotations
@Override
manualReconnectback to summary
public void manualReconnect(Connection connection)

Implements org.hibernate.resource.jdbc.spi.LogicalConnectionImplementor.manualReconnect.

Doc from org.hibernate.resource.jdbc.spi.LogicalConnectionImplementor.manualReconnect.

Manually reconnect the underlying JDBC Connection. Should be called at some point after manualDisconnect().

Parameters
connection: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.

Annotations
@Override
serializeback to summary
public void serialize(ObjectOutputStream oos) throws IOException

Implements org.hibernate.resource.jdbc.spi.LogicalConnectionImplementor.serialize.

Doc from org.hibernate.resource.jdbc.spi.LogicalConnectionImplementor.serialize.

Serialization hook

Parameters
oos:ObjectOutputStream

The stream to write out state to

Annotations
@Override
Exceptions
IOException:
Problem accessing stream