From 37b0b36918f14519b28326057bba38ca6fcfbd3b Mon Sep 17 00:00:00 2001 From: Nick Date: Sat, 19 Apr 2008 23:11:28 -0500 Subject: Fix failure to retain value of allow_concurrency - Also carry allow_concurrency value through to connection adapter (for postgresql) --- .../lib/active_record/connection_adapters/abstract/connection_pool.rb | 3 ++- .../connection_adapters/abstract/connection_specification.rb | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'activerecord/lib/active_record/connection_adapters') 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 2d13d02fad..08fc61daaa 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb @@ -97,7 +97,8 @@ module ActiveRecord if spec.kind_of?(ActiveRecord::ConnectionAdapters::AbstractAdapter) active_connections[active_connection_name] = spec elsif spec.kind_of?(ActiveRecord::Base::ConnectionSpecification) - self.set_connection ActiveRecord::Base.send(spec.adapter_method, spec.config) + config = spec.config.reverse_merge(:allow_concurrency => ActiveRecord::Base.allow_concurrency) + self.set_connection ActiveRecord::Base.send(spec.adapter_method, config) else raise ConnectionNotEstablished end diff --git a/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb b/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb index ed9d074506..ddca97c3bf 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb @@ -31,6 +31,7 @@ module ActiveRecord # multi-threaded access of the connection pools hash is synchronized. def allow_concurrency=(flag) if @@allow_concurrency != flag + @@allow_concurrency = flag if flag self.connection_pools_lock = Monitor.new else -- cgit v1.2.3