run

run() Instance Public methods

new

new(spec) Class Public methods Creates a new ConnectionPool object. spec is a ConnectionSpecification object which describes database connection information (e.g. adapter, host name, username, password, etc), as well as the maximum size for this ConnectionPool. The default ConnectionPool maximum size is 5.

active_connection?

active_connection?() Instance Public methods Is there an open connection that is being used for the current thread?

checkin

checkin(conn) Instance Public methods Check-in a database connection back into the pool, indicating that you no longer need this connection. conn: an AbstractAdapter object, which was obtained by earlier by calling checkout on this pool.

checkout

checkout() Instance Public methods Check-out a database connection from the pool, indicating that you want to use it. You should call checkin when you no longer need this. This is done by either returning and leasing existing connection, or by creating a new connection and leasing it. If all connections are leased and the pool is at capacity (meaning the number of currently leased connections is greater than or equal to the size limit set), an ActiveRecord::ConnectionTimeoutError e

clear_reloadable_connections!

clear_reloadable_connections!() Instance Public methods Clears the cache which maps classes.

connected?

connected?() Instance Public methods Returns true if a connection has already been opened.

connection

connection() Instance Public methods Retrieve the connection associated with the current thread, or call checkout to obtain one if necessary. connection can be called any number of times; the connection is held in a hash keyed by the thread id.

disconnect!

disconnect!() Instance Public methods Disconnects all connections in the pool, and clears the pool.

insert_connection_for_test!

insert_connection_for_test!(c) Instance Public methods