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 Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
ConnectionManager.Callback |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs a ConnectionManager.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
To be called after execution of each JDBC statement.
| |||||||||||
To be called after local transaction completion.
| |||||||||||
To be called after Session completion.
| |||||||||||
Callback to let us know that a flush is beginning.
| |||||||||||
Callback to let us know that a flush is ending.
| |||||||||||
The batcher managed by this ConnectionManager.
| |||||||||||
Retrieves the connection currently managed by this ConnectionManager.
| |||||||||||
The session factory.
| |||||||||||
Will connections be released after each statement execution?
Connections will be released after each statement if either:
| |||||||||||
Is the connection considered "auto-commit"?
| |||||||||||
Is this ConnectionManager instance "logically" connected.
| |||||||||||
Was the connection being used here supplied by the user?
| |||||||||||
Manually disconnect the underlying JDBC Connection.
| |||||||||||
Manually reconnect the underlying JDBC Connection.
| |||||||||||
Manually reconnect the underlying JDBC Connection.
| |||||||||||
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Constructs a ConnectionManager.
This is the form used internally.factory | The SessionFactory. |
---|---|
callback | An observer for internal state change. |
releaseMode | The mode by which to release JDBC connections. |
connection | An externally supplied connection. |
To be called after execution of each JDBC statement. Used to conditionally release the JDBC connection aggressively if the configured release mode indicates.
To be called after local transaction completion. Used to conditionally release the JDBC connection aggressively if the configured release mode indicates.
To be called after Session completion. Used to release the JDBC connection.
IOException |
---|
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()
Callback to let us know that a flush is ending. We use this fact to stop circumventing aggressive releasing connections.
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).HibernateException | Indicates a connection is currently not available (we are currently manually disconnected). |
---|
Will connections be released after each statement execution?
Connections will be released after each statement if either:AFTER_STATEMENT
; or
AFTER_TRANSACTION
but
we are in auto-commit mode.
release-mode = ON_CLOSE
should [b]never[/b] release
a connection.Is the connection considered "auto-commit"?
SQLException | Can be thrown by the Connection.isAutoCommit() check. |
---|
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.
Was the connection being used here supplied by the user?
Manually disconnect the underlying JDBC Connection. The assumption here is that the manager will be reconnected at a later point in time.
Manually reconnect the underlying JDBC Connection. Should be called at some point after manualDisconnect().
This form is used for user-supplied connections.Manually reconnect the underlying JDBC Connection. Should be called at some point after manualDisconnect().
This form is used for ConnectionProvider-supplied connections.