|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hibernate.jdbc.ConnectionManager
Encapsulates JDBC Connection management logic needed by Hibernate.
The lifecycle is intended to span a logical series of interactions with the database. Internally, this means the the lifecycle of the Session.
Nested Class Summary | |
static interface |
ConnectionManager.Callback
|
Constructor Summary | |
ConnectionManager(SessionFactoryImplementor factory,
ConnectionManager.Callback callback,
ConnectionReleaseMode releaseMode,
Connection connection)
Constructs a ConnectionManager. |
Method Summary | |
void |
afterStatement()
To be called after execution of each JDBC statement. |
void |
afterTransaction()
To be called after local transaction completion. |
Connection |
close()
To be called after Session completion. |
protected void |
finalize()
Just in case user forgot to commit()/cancel() or close() |
Batcher |
getBatcher()
The batcher managed by this ConnectionManager. |
Connection |
getConnection()
Retreives the connection currently managed by this ConnectionManager. |
SessionFactoryImplementor |
getFactory()
The session factory. |
boolean |
isAutoCommit()
Is the connection considered "auto-commit"? |
boolean |
isLogicallyConnected()
Is this ConnectionManager instance "logically" connected. |
boolean |
isPhysicallyConnected()
Is theis ConnectionManager instance "physically" connection. |
Connection |
manualDisconnect()
Manually disconnect the underlying JDBC Connection. |
void |
manualReconnect()
Manually reconnect the underlying JDBC Connection. |
void |
manualReconnect(Connection suppliedConnection)
Manually reconnect the underlying JDBC Connection. |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ConnectionManager(SessionFactoryImplementor factory, ConnectionManager.Callback callback, ConnectionReleaseMode releaseMode, Connection connection)
factory
- The SessionFactory.callback
- An observer for internal state change.releaseMode
- The mode by which to release JDBC connections.connection
- An externally supplied connection.Method Detail |
public SessionFactoryImplementor getFactory()
public Batcher getBatcher()
public Connection getConnection() throws HibernateException
HibernateException
- Indicates a connection is currently not
available (we are currently manually disconnected).public boolean isAutoCommit() throws SQLException
SQLException
- Can be thrown by the Connection.isAutoCommit() check.public boolean isLogicallyConnected()
public boolean isPhysicallyConnected()
public void afterStatement()
public void afterTransaction()
public Connection close()
public Connection manualDisconnect()
public void manualReconnect()
public void manualReconnect(Connection suppliedConnection)
protected void finalize() throws Throwable
Throwable
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |