The lifecycle is intended to span a logical series of interactions with the database. Internally, this means the the lifecycle of the Session.
| Modifier and Type | Class and Description |
|---|---|
| public static interface |
| Modifier and Type | Field and Description |
|---|---|
| private transient Batcher | |
| private transient Connection | |
| private final ConnectionManager. | |
| private transient Connection | |
| private transient SessionFactoryImplementor | |
| private transient Interceptor | |
| private boolean | |
| private transient boolean | |
| private static final Logger | |
| private final ConnectionReleaseMode | |
| private final boolean |
| Access | Constructor and Description |
|---|---|
| public | ConnectionManager(SessionFactoryImplementor
The SessionFactory. factory, ConnectionManager.An observer for internal state change. callback,The mode by which to release JDBC connections. releaseMode, Connection An externally supplied connection. connection, Interceptor interceptor)Constructs a ConnectionManager. |
| private | ConnectionManager(SessionFactoryImplementor factory, ConnectionManager.
Private constructor used exclusively from custom serialization |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| private void | aggressiveRelease()
Performs actions required to perform an aggressive release of the JDBC Connection. |
| public Connection | |
| private Connection | Returns: The released connection.Releases the Connection and cleans up any resources associated with that Connection. |
| public Connection | Returns: The connection mantained here at time of close. Null if there was no connection cached internally.To be called after Session completion. |
| private void | |
| public static ConnectionManager | deserialize(ObjectInputStream ois, SessionFactoryImplementor factory, Interceptor interceptor, ConnectionReleaseMode connectionReleaseMode, JDBCContext jdbcContext)
|
| public void | |
| public void | |
| public Batcher | |
| public Connection | Returns: The current Connection.Retrieves the connection currently managed by this ConnectionManager. |
| public SessionFactoryImplementor | |
| public boolean | |
| private boolean | |
| public boolean | Returns: True if the connections will be released after each statement; false otherwise.Will connections be released after each statement execution? |
| private boolean | Returns: True if the connections will be released after each statement; false otherwise.Modified version of |
| public boolean | Returns: True if we either do not have a connection, or the connection really is in auto-commit mode.Is the connection considered "auto-commit"? |
| public boolean | Returns: True if logically connected; false otherwise.Is this ConnectionManager instance "logically" connected. |
| private boolean | |
| public boolean | |
| public boolean | Returns: True if the user supplied the JDBC connection; false otherwiseWas the connection being used here supplied by the user? |
| public Connection | Returns: The connection mantained here at time of disconnect. Null if there was no connection cached internally.Manually disconnect the underlying JDBC Connection. |
| public void | |
| public void | |
| private void | |
| private void | readObject(ObjectInputStream
The stream from which we are being read. ois)Used during deserialization. |
| public void | |
| public void | |
| private void | writeObject(ObjectOutputStream
The stream to which we are being written. oos)Used during serialization. |
| batcher | back to summary |
|---|---|
| private transient Batcher batcher | |
| borrowedConnection | back to summary |
|---|---|
| private transient Connection borrowedConnection | |
| callback | back to summary |
|---|---|
| private final ConnectionManager. | |
| connection | back to summary |
|---|---|
| private transient Connection connection | |
| factory | back to summary |
|---|---|
| private transient SessionFactoryImplementor factory | |
| interceptor | back to summary |
|---|---|
| private transient Interceptor interceptor | |
| isClosed | back to summary |
|---|---|
| private boolean isClosed | |
| isFlushing | back to summary |
|---|---|
| private transient boolean isFlushing | |
| log | back to summary |
|---|---|
| private static final Logger log | |
| releaseMode | back to summary |
|---|---|
| private final ConnectionReleaseMode releaseMode | |
| wasConnectionSupplied | back to summary |
|---|---|
| private final boolean wasConnectionSupplied | |
| ConnectionManager | back to summary |
|---|---|
| public ConnectionManager(SessionFactoryImplementor factory, ConnectionManager. Constructs a ConnectionManager. This is the form used internally.
| |
| ConnectionManager | back to summary |
|---|---|
| private ConnectionManager(SessionFactoryImplementor factory, ConnectionManager. Private constructor used exclusively from custom serialization | |
| afterStatement | back to summary |
|---|---|
| public void afterStatement() To be called after execution of each JDBC statement. Used to conditionally release the JDBC connection aggressively if the configured release mode indicates. | |
| afterTransaction | back to summary |
|---|---|
| public void afterTransaction() To be called after local transaction completion. Used to conditionally release the JDBC connection aggressively if the configured release mode indicates. | |
| aggressiveRelease | back to summary |
|---|---|
| private void aggressiveRelease() Performs actions required to perform an aggressive release of the JDBC Connection. | |
| borrowConnection | back to summary |
|---|---|
| public Connection borrowConnection() | |
| cleanup | back to summary |
|---|---|
| private Connection cleanup() throws HibernateException Releases the Connection and cleans up any resources associated with that Connection. This is intended for use: 1) at the end of the session 2) on a manual disconnect of the session 3) from afterTransaction(), in the case of skipped aggressive releasing
| |
| close | back to summary |
|---|---|
| public Connection close() To be called after Session completion. Used to release the JDBC connection.
| |
| closeConnection | back to summary |
|---|---|
| private void closeConnection() Physically closes the JDBC Connection. | |
| deserialize | back to summary |
|---|---|
| public static ConnectionManager deserialize(ObjectInputStream ois, SessionFactoryImplementor factory, Interceptor interceptor, ConnectionReleaseMode connectionReleaseMode, JDBCContext jdbcContext) throws IOException | |
| flushBeginning | back to summary |
|---|---|
| public void flushBeginning() Callback to let us know that a flush is beginning. We use this fact
to temporarily circumvent aggressive connection releasing until after
the flush cycle is complete | |
| flushEnding | back to summary |
|---|---|
| public void flushEnding() Callback to let us know that a flush is ending. We use this fact to stop circumventing aggressive releasing connections. | |
| getBatcher | back to summary |
|---|---|
| public Batcher getBatcher() The batcher managed by this ConnectionManager.
| |
| getConnection | back to summary |
|---|---|
| public Connection getConnection() throws HibernateException Retrieves the connection currently managed by this ConnectionManager. Note, that we may need to obtain a connection to return here if a connection has either not yet been obtained (non-UserSuppliedConnectionProvider) or has previously been aggressively released (if supported in this environment).
| |
| getFactory | back to summary |
|---|---|
| public SessionFactoryImplementor getFactory() The session factory.
| |
| hasBorrowedConnection | back to summary |
|---|---|
| public boolean hasBorrowedConnection() | |
| isAfterTransactionRelease | back to summary |
|---|---|
| private boolean isAfterTransactionRelease() | |
| isAggressiveRelease | back to summary |
|---|---|
| public boolean isAggressiveRelease() Will connections be released after each statement execution? Connections will be released after each statement if either:
| |
| isAggressiveReleaseNoTransactionCheck | back to summary |
|---|---|
| private boolean isAggressiveReleaseNoTransactionCheck() Modified version of
| |
| isAutoCommit | back to summary |
|---|---|
| public boolean isAutoCommit() throws SQLException Is the connection considered "auto-commit"?
| |
| isCurrentlyConnected | back to summary |
|---|---|
| public boolean isCurrentlyConnected() Is this ConnectionManager instance "logically" connected. Meaning do we either have a cached connection available or do we have the ability to obtain a connection on demand.
| |
| isOnCloseRelease | back to summary |
|---|---|
| private boolean isOnCloseRelease() | |
| isReadyForSerialization | back to summary |
|---|---|
| public boolean isReadyForSerialization() | |
| isSuppliedConnection | back to summary |
|---|---|
| public boolean isSuppliedConnection() Was the connection being used here supplied by the user?
| |
| manualDisconnect | back to summary |
|---|---|
| public Connection manualDisconnect() Manually disconnect the underlying JDBC Connection. The assumption here is that the manager will be reconnected at a later point in time.
| |
| manualReconnect | back to summary |
|---|---|
| public void manualReconnect() Manually reconnect the underlying JDBC Connection. Should be called at some point after manualDisconnect(). This form is used for ConnectionProvider-supplied connections. | |
| manualReconnect | back to summary |
|---|---|
| public void manualReconnect(Connection suppliedConnection) Manually reconnect the underlying JDBC Connection. Should be called at some point after manualDisconnect(). This form is used for user-supplied connections. | |
| openConnection | back to summary |
|---|---|
| private void openConnection() throws HibernateException Pysically opens a JDBC Connection. | |
| readObject | back to summary |
|---|---|
| private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException Used during deserialization.
| |
| releaseBorrowedConnection | back to summary |
|---|---|
| public void releaseBorrowedConnection() | |
| serialize | back to summary |
|---|---|
| public void serialize(ObjectOutputStream oos) throws IOException | |
| writeObject | back to summary |
|---|---|
| private void writeObject(ObjectOutputStream oos) throws IOException Used during serialization.
| |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| public boolean |
| connectionCleanedUp | back to summary |
|---|---|
| public void connectionCleanedUp() | |
| connectionOpened | back to summary |
|---|---|
| public void connectionOpened() | |
| isTransactionInProgress | back to summary |
|---|---|
| public boolean isTransactionInProgress() | |