release_connection

release_connection(with_id = current_connection_id) Instance Public methods Signal that the thread is finished with the current connection. release_connection releases the connection-thread association and returns the connection to the pool.

reap

reap() Instance Public methods Removes dead connections from the pool. A dead connection can occur if a programmer forgets to close a connection at the end of a thread or a thread dies unexpectedly.

insert_connection_for_test!

insert_connection_for_test!(c) Instance Public methods

disconnect!

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

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.

connected?

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

clear_reloadable_connections!

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

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

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.

active_connection?

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