aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2011-03-29 15:42:32 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2011-03-29 15:42:32 -0700
commit3b2a032677a2261499aa5d2de019f31f1173a858 (patch)
tree6999aa919a2c10c7833b9b29b4097bcb92fc04d4 /activerecord/lib
parente5246092d1ce30961af4f7d9b5ad86071298cf1c (diff)
downloadrails-3b2a032677a2261499aa5d2de019f31f1173a858.tar.gz
rails-3b2a032677a2261499aa5d2de019f31f1173a858.tar.bz2
rails-3b2a032677a2261499aa5d2de019f31f1173a858.zip
clearing active connections in the ConnectionManagement middleware if an exception happens
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb3
1 files changed, 3 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 5e12f80263..45900d27dc 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb
@@ -446,6 +446,9 @@ module ActiveRecord
status, headers, body = @app.call(env)
[status, headers, Proxy.new(body, env.key?('rack.test'))]
+ rescue
+ ActiveRecord::Base.clear_active_connections!
+ raise
end
end
end