diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-11-28 15:10:41 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-11-28 15:23:26 -0800 |
commit | beff819a4d7060b7635410d2c4621be735033240 (patch) | |
tree | aabbaa9ecdf67d14360238e68673035d925969b3 | |
parent | 884a04007fd09a94cdaf484a6c92819af8fc1b4e (diff) | |
download | rails-beff819a4d7060b7635410d2c4621be735033240.tar.gz rails-beff819a4d7060b7635410d2c4621be735033240.tar.bz2 rails-beff819a4d7060b7635410d2c4621be735033240.zip |
just check in all connections
-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| |