Type:
Class

ConnectionHandler is a collection of ConnectionPool objects. It is used for keeping separate connection pools for Active Record models that connect to different databases.

For example, suppose that you have 5 models, with the following hierarchy:

|
+-- Book
|    |
|    +-- ScaryBook
|    +-- GoodBook
+-- Author
+-- BankAccount

Suppose that Book is to connect to a separate database (i.e. one other than the default database). Then Book, ScaryBook and GoodBook will all use the same connection pool. Likewise, Author and BankAccount will use the same connection pool. However, the connection pool used by Author/BankAccount is not the same as the one used by Book/ScaryBook/GoodBook.

Normally there is only a single ConnectionHandler instance, accessible via ActiveRecord::Core.connection_handler. Active Record models use this to determine the connection pool that they should use.

active_connections?

active_connections?() Instance Public methods Returns true if there are any

2015-06-20 00:00:00
connected?

connected?(klass) Instance Public methods Returns true if a connection that's

2015-06-20 00:00:00
connection_pools

connection_pools() Instance Public methods

2015-06-20 00:00:00
remove_connection

remove_connection(owner) Instance Public methods Remove the connection for this

2015-06-20 00:00:00
connection_pool_list

connection_pool_list() Instance Public methods

2015-06-20 00:00:00
clear_reloadable_connections!

clear_reloadable_connections!() Instance Public methods Clears the cache which

2015-06-20 00:00:00
establish_connection

establish_connection(owner, spec) Instance Public methods

2015-06-20 00:00:00
clear_active_connections!

clear_active_connections!() Instance Public methods Returns any connections

2015-06-20 00:00:00
new

new() Class Public methods

2015-06-20 00:00:00
clear_all_connections!

clear_all_connections!() Instance Public methods

2015-06-20 00:00:00