diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-12-30 14:14:13 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-12-30 14:14:13 -0800 |
commit | e060cf01a5e05bc6eaeee90b8c421d2aa6435b7c (patch) | |
tree | 033f343f95d5d7d8060afc74d6b19c2394d23264 /activerecord/lib/active_record | |
parent | 17ff88c4d425d7b55ff1a1225cb56f293e7dd7eb (diff) | |
download | rails-e060cf01a5e05bc6eaeee90b8c421d2aa6435b7c.tar.gz rails-e060cf01a5e05bc6eaeee90b8c421d2aa6435b7c.tar.bz2 rails-e060cf01a5e05bc6eaeee90b8c421d2aa6435b7c.zip |
deal with removing connections associated with the current thread
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb | 7 |
1 files changed, 7 insertions, 0 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 3f54a98380..a88c9e2c4b 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb @@ -222,6 +222,13 @@ module ActiveRecord def remove(conn) synchronize do @connections.delete conn + + # FIXME: we might want to store the key on the connection so that removing + # from the reserved hash will be a little easier. + thread_id = @reserved_connections.keys.find { |k| + @reserved_connections[k] == conn + } + @reserved_connections.delete thread_id if thread_id end end |