Save This Page
Home » hibernate-distribution-3.3.1.GA-dist » org.hibernate » jdbc » [javadoc | source]
org.hibernate.jdbc
public class: ConnectionManager [javadoc | source]
java.lang.Object
   org.hibernate.jdbc.ConnectionManager

All Implemented Interfaces:
    Serializable

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:
public static interface  ConnectionManager.Callback   
Constructor:
 public ConnectionManager(SessionFactoryImplementor factory,
    ConnectionManager.Callback callback,
    ConnectionReleaseMode releaseMode,
    Connection connection,
    Interceptor interceptor) 
    Constructs a ConnectionManager.

    This is the form used internally.

    Parameters:
    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 from org.hibernate.jdbc.ConnectionManager Summary:
afterStatement,   afterTransaction,   borrowConnection,   close,   deserialize,   flushBeginning,   flushEnding,   getBatcher,   getConnection,   getFactory,   hasBorrowedConnection,   isAggressiveRelease,   isAutoCommit,   isCurrentlyConnected,   isReadyForSerialization,   isSuppliedConnection,   manualDisconnect,   manualReconnect,   manualReconnect,   releaseBorrowedConnection,   serialize
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.hibernate.jdbc.ConnectionManager Detail:
 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.
 public  void afterTransaction() 
    To be called after local transaction completion. Used to conditionally release the JDBC connection aggressively if the configured release mode indicates.
 public Connection borrowConnection() 
 public Connection close() 
    To be called after Session completion. Used to release the JDBC connection.
 public static ConnectionManager deserialize(ObjectInputStream ois,
    SessionFactoryImplementor factory,
    Interceptor interceptor,
    ConnectionReleaseMode connectionReleaseMode,
    JDBCContext jdbcContext) throws IOException 
 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()
 public  void flushEnding() 
    Callback to let us know that a flush is ending. We use this fact to stop circumventing aggressive releasing connections.
 public Batcher getBatcher() 
    The batcher managed by this ConnectionManager.
 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).

 public SessionFactoryImplementor getFactory() 
    The session factory.
 public boolean hasBorrowedConnection() 
 public boolean isAggressiveRelease() 
 public boolean isAutoCommit() throws SQLException 
    Is the connection considered "auto-commit"?
 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.
 public boolean isReadyForSerialization() 
 public boolean isSuppliedConnection() 
    Was the connection being used here supplied by the user?
 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.
 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.

 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.

 public  void releaseBorrowedConnection() 
 public  void serialize(ObjectOutputStream oos) throws IOException