diff options
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb b/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb index 78cea5e2f7..061ec878c2 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb @@ -128,11 +128,9 @@ module ActiveRecord # Disconnects all connections in the pool, and clears the pool. def disconnect! - @reserved_connections.each do |name,conn| - checkin conn - end @reserved_connections = {} @connections.each do |conn| + checkin conn conn.disconnect! end @connections = [] @@ -140,11 +138,9 @@ module ActiveRecord # Clears the cache which maps classes. def clear_reloadable_connections! - @reserved_connections.each do |name, conn| - checkin conn - end @reserved_connections = {} @connections.each do |conn| + checkin conn conn.disconnect! if conn.requires_reloading? end @connections.delete_if do |conn| |