public class LogicalConnectionImpl extends Object implements LogicalConnectionImplementor
LogicalConnection implementation
IMPL NOTE : Custom serialization handling!| Constructor and Description |
|---|
LogicalConnectionImpl(Connection userSuppliedConnection,
ConnectionReleaseMode connectionReleaseMode,
JdbcServices jdbcServices,
JdbcConnectionAccess jdbcConnectionAccess)
Constructs a LogicalConnectionImpl
|
| Modifier and Type | Method and Description |
|---|---|
void |
addObserver(ConnectionObserver observer)
Add an observer interested in notification of connection events.
|
void |
aggressiveRelease()
Force aggressive release of the underlying connection.
|
Connection |
close()
Release the underlying connection and clean up any other resources associated
with this logical connection.
|
static LogicalConnectionImpl |
deserialize(ObjectInputStream ois,
TransactionContext transactionContext)
Deserialization hook
|
Connection |
getConnection()
Retrieves the connection currently "logically" managed by this LogicalConnectionImpl.
|
ConnectionReleaseMode |
getConnectionReleaseMode()
The release mode under which this logical connection is operating.
|
JdbcServices |
getJdbcServices()
Obtains the JDBC services associated with this logical connection.
|
boolean |
isAutoCommit()
Is this logical connection in auto-commit mode?
|
boolean |
isOpen()
Is this logical connection open? Another phraseology sometimes used is: "are we
logically connected"?
|
boolean |
isPhysicallyConnected()
Is this logical connection instance "physically" connected.
|
boolean |
isUserSuppliedConnection()
Does this logical connection wrap a user/application supplied connection?
|
Connection |
manualDisconnect()
Manually disconnect the underlying JDBC Connection.
|
void |
manualReconnect(Connection suppliedConnection)
Manually reconnect the underlying JDBC Connection.
|
void |
notifyObserversStatementPrepared()
Callback to notify all registered observers of a connection being prepared.
|
void |
releaseConnection()
Physically closes the JDBC Connection.
|
void |
removeObserver(ConnectionObserver connectionObserver)
Remove an observer
|
void |
serialize(ObjectOutputStream oos)
Serialization hook
|
public LogicalConnectionImpl(Connection userSuppliedConnection, ConnectionReleaseMode connectionReleaseMode, JdbcServices jdbcServices, JdbcConnectionAccess jdbcConnectionAccess)
userSuppliedConnection - The user-supplied connectionconnectionReleaseMode - The connection release mode to usejdbcServices - JdbcServicesjdbcConnectionAccess - JDBC Connection accesspublic JdbcServices getJdbcServices()
LogicalConnectionImplementorgetJdbcServices in interface LogicalConnectionImplementorpublic void addObserver(ConnectionObserver observer)
LogicalConnectionImplementoraddObserver in interface LogicalConnectionImplementorobserver - The observer.public void removeObserver(ConnectionObserver connectionObserver)
LogicalConnectionImplementorremoveObserver in interface LogicalConnectionImplementorconnectionObserver - The observer to remove.public boolean isOpen()
LogicalConnectionisOpen in interface LogicalConnectionpublic boolean isPhysicallyConnected()
LogicalConnectionisPhysicallyConnected in interface LogicalConnectionpublic Connection getConnection() throws HibernateException
LogicalConnectiongetConnection in interface LogicalConnectionHibernateExceptionpublic Connection close()
LogicalConnectionclose in interface LogicalConnectionnull if Hibernate was managing connection.public ConnectionReleaseMode getConnectionReleaseMode()
LogicalConnectionImplementorgetConnectionReleaseMode in interface LogicalConnectionImplementorpublic void aggressiveRelease()
aggressiveRelease in interface LogicalConnectionImplementorpublic void releaseConnection()
throws JDBCException
releaseConnection in interface LogicalConnectionImplementorJDBCException - Indicates problem closing a connectionpublic Connection manualDisconnect()
LogicalConnectionImplementormanualDisconnect in interface LogicalConnectionImplementorpublic void manualReconnect(Connection suppliedConnection)
LogicalConnectionImplementormanualReconnect in interface LogicalConnectionImplementorsuppliedConnection - 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.public boolean isAutoCommit()
LogicalConnectionImplementorisAutoCommit in interface LogicalConnectionImplementortrue if auto-commitpublic boolean isUserSuppliedConnection()
LogicalConnectionImplementorisUserSuppliedConnection in interface LogicalConnectionImplementortrue if the underlying connection was user supplied.public void notifyObserversStatementPrepared()
LogicalConnectionImplementornotifyObserversStatementPrepared in interface LogicalConnectionImplementorpublic void serialize(ObjectOutputStream oos) throws IOException
oos - The stream to write out state toIOException - Problem accessing streampublic static LogicalConnectionImpl deserialize(ObjectInputStream ois, TransactionContext transactionContext) throws IOException, ClassNotFoundException
ois - The stream to read our state fromtransactionContext - The transactionContext which owns this logical connectionIOException - Trouble accessing the streamClassNotFoundException - Trouble reading the streamCopyright © 2001-2015 Red Hat, Inc. All Rights Reserved.