|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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,
Interceptor interceptor)
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 |
borrowConnection()
|
Connection |
close()
To be called after Session completion. |
static ConnectionManager |
deserialize(ObjectInputStream ois,
SessionFactoryImplementor factory,
Interceptor interceptor,
ConnectionReleaseMode connectionReleaseMode,
JDBCContext jdbcContext)
|
void |
flushBeginning()
Callback to let us know that a flush is beginning. |
void |
flushEnding()
Callback to let us know that a flush is ending. |
Batcher |
getBatcher()
The batcher managed by this ConnectionManager. |
Connection |
getConnection()
Retrieves the connection currently managed by this ConnectionManager. |
SessionFactoryImplementor |
getFactory()
The session factory. |
boolean |
hasBorrowedConnection()
|
boolean |
isAggressiveRelease()
Will connections be released after each statement execution? Connections will be released after each statement if either: the defined release-mode is ConnectionReleaseMode.AFTER_STATEMENT ; or
the defined release-mode is ConnectionReleaseMode.AFTER_TRANSACTION but
we are in auto-commit mode. |
boolean |
isAutoCommit()
Is the connection considered "auto-commit"? |
boolean |
isCurrentlyConnected()
Is this ConnectionManager instance "logically" connected. |
boolean |
isReadyForSerialization()
|
boolean |
isSuppliedConnection()
Was the connection being used here supplied by the user? |
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. |
void |
releaseBorrowedConnection()
|
void |
serialize(ObjectOutputStream oos)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ConnectionManager(SessionFactoryImplementor factory, ConnectionManager.Callback callback, ConnectionReleaseMode releaseMode, Connection connection, Interceptor interceptor)
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 boolean isSuppliedConnection()
public Connection getConnection() throws HibernateException
HibernateException
- Indicates a connection is currently not
available (we are currently manually disconnected).public boolean hasBorrowedConnection()
public Connection borrowConnection()
public void releaseBorrowedConnection()
public boolean isAutoCommit() throws SQLException
SQLException
- Can be thrown by the Connection.isAutoCommit() check.public boolean isAggressiveRelease()
ConnectionReleaseMode.AFTER_STATEMENT
; or
ConnectionReleaseMode.AFTER_TRANSACTION
but
we are in auto-commit mode.
release-mode = ConnectionReleaseMode.ON_CLOSE
should [b]never[/b] release
a connection.
public boolean isCurrentlyConnected()
public void afterStatement()
public void afterTransaction()
public Connection close()
public Connection manualDisconnect()
public void manualReconnect()
public void manualReconnect(Connection suppliedConnection)
public void flushBeginning()
flushEnding()
public void flushEnding()
public boolean isReadyForSerialization()
public void serialize(ObjectOutputStream oos) throws IOException
IOException
public static ConnectionManager deserialize(ObjectInputStream ois, SessionFactoryImplementor factory, Interceptor interceptor, ConnectionReleaseMode connectionReleaseMode, JDBCContext jdbcContext) throws IOException
IOException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |