Fix failure to retain value of allow_concurrency
- Also carry allow_concurrency value through to connection adapter (for postgresql)
This commit is contained in:
parent
cab76ce6ac
commit
37b0b36918
|
@ -97,7 +97,8 @@ module ActiveRecord
|
||||||
if spec.kind_of?(ActiveRecord::ConnectionAdapters::AbstractAdapter)
|
if spec.kind_of?(ActiveRecord::ConnectionAdapters::AbstractAdapter)
|
||||||
active_connections[active_connection_name] = spec
|
active_connections[active_connection_name] = spec
|
||||||
elsif spec.kind_of?(ActiveRecord::Base::ConnectionSpecification)
|
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
|
else
|
||||||
raise ConnectionNotEstablished
|
raise ConnectionNotEstablished
|
||||||
end
|
end
|
||||||
|
|
|
@ -31,6 +31,7 @@ module ActiveRecord
|
||||||
# multi-threaded access of the connection pools hash is synchronized.
|
# multi-threaded access of the connection pools hash is synchronized.
|
||||||
def allow_concurrency=(flag)
|
def allow_concurrency=(flag)
|
||||||
if @@allow_concurrency != flag
|
if @@allow_concurrency != flag
|
||||||
|
@@allow_concurrency = flag
|
||||||
if flag
|
if flag
|
||||||
self.connection_pools_lock = Monitor.new
|
self.connection_pools_lock = Monitor.new
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue