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) |
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) |
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() |
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() |
Connection |
manualDisconnect()
Manually disconnect the underlying JDBC Connection.
|
void |
manualReconnect(Connection suppliedConnection)
Manually reconnect the underlying JDBC Connection.
|
void |
notifyObserversStatementPrepared() |
void |
releaseConnection()
Physically closes the JDBC Connection.
|
void |
removeObserver(ConnectionObserver connectionObserver)
Remove an observer
|
void |
serialize(ObjectOutputStream oos) |
public LogicalConnectionImpl(Connection userSuppliedConnection, ConnectionReleaseMode connectionReleaseMode, JdbcServices jdbcServices, JdbcConnectionAccess jdbcConnectionAccess)
public JdbcServices getJdbcServices()
LogicalConnectionImplementor
getJdbcServices
in interface LogicalConnectionImplementor
public void addObserver(ConnectionObserver observer)
LogicalConnectionImplementor
addObserver
in interface LogicalConnectionImplementor
observer
- The observer.public void removeObserver(ConnectionObserver connectionObserver)
LogicalConnectionImplementor
removeObserver
in interface LogicalConnectionImplementor
connectionObserver
- The observer to remove.public boolean isOpen()
LogicalConnection
isOpen
in interface LogicalConnection
public boolean isPhysicallyConnected()
LogicalConnection
isPhysicallyConnected
in interface LogicalConnection
public Connection getConnection() throws HibernateException
LogicalConnection
getConnection
in interface LogicalConnection
HibernateException
public Connection close()
LogicalConnection
close
in interface LogicalConnection
null
if Hibernate was managing connection.public ConnectionReleaseMode getConnectionReleaseMode()
LogicalConnectionImplementor
getConnectionReleaseMode
in interface LogicalConnectionImplementor
public void aggressiveRelease()
aggressiveRelease
in interface LogicalConnectionImplementor
public void releaseConnection() throws JDBCException
releaseConnection
in interface LogicalConnectionImplementor
JDBCException
- Indicates problem closing a connectionpublic Connection manualDisconnect()
LogicalConnectionImplementor
manualDisconnect
in interface LogicalConnectionImplementor
public void manualReconnect(Connection suppliedConnection)
LogicalConnectionImplementor
manualReconnect
in interface LogicalConnectionImplementor
suppliedConnection
- 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()
isAutoCommit
in interface LogicalConnectionImplementor
public boolean isUserSuppliedConnection()
isUserSuppliedConnection
in interface LogicalConnectionImplementor
public void notifyObserversStatementPrepared()
notifyObserversStatementPrepared
in interface LogicalConnectionImplementor
public void serialize(ObjectOutputStream oos) throws IOException
IOException
public static LogicalConnectionImpl deserialize(ObjectInputStream ois, TransactionContext transactionContext) throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
Copyright © 2018 JBoss by Red Hat. All rights reserved.