diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-07-10 04:54:34 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-07-10 04:54:34 +0000 |
commit | 60499774c2a8ecd9d87b140ffbe24634559c3fcd (patch) | |
tree | e4e2a348e4dae4d107f020f9c21664a5e169b92c /activerecord/lib/active_record/query_cache.rb | |
parent | e008bfd2d8e8e19eb94ddb49121820effe93d7f4 (diff) | |
download | rails-60499774c2a8ecd9d87b140ffbe24634559c3fcd.tar.gz rails-60499774c2a8ecd9d87b140ffbe24634559c3fcd.tar.bz2 rails-60499774c2a8ecd9d87b140ffbe24634559c3fcd.zip |
Fixed that each request with the WEBrick adapter would open a new database connection #1685 [Sam Stephenson]. Added ActiveRecord::Base.threaded_connections flag to turn off 1-connection per thread (required for thread safety). By default it's on, but WEBrick in Rails need it off #1685 [Sam Stephenson]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1792 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib/active_record/query_cache.rb')
-rw-r--r-- | activerecord/lib/active_record/query_cache.rb | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/query_cache.rb b/activerecord/lib/active_record/query_cache.rb index 95b4d8c915..c41567375f 100644 --- a/activerecord/lib/active_record/query_cache.rb +++ b/activerecord/lib/active_record/query_cache.rb @@ -51,8 +51,7 @@ module ActiveRecord QueryCache.new(self.send(spec.adapter_method, spec.config)) : self.send(spec.adapter_method, spec.config) - Thread.current['active_connections'] ||= {} - Thread.current['active_connections'][self] = conn + active_connections[self] = conn end end |