diff options
author | Nick Sieger <nick@nicksieger.com> | 2008-08-22 12:19:29 -0500 |
---|---|---|
committer | Nick Sieger <nick@nicksieger.com> | 2008-08-29 14:12:12 -0500 |
commit | ca6d71753f3a2e8a0a29108b7c55ba3b7c8cd943 (patch) | |
tree | d0527720f9d7ceaa46fd6a8844fecd46aaa0ae18 /activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb | |
parent | a96b7d4c33757364a19ed1fc34f0a89801b8b2d7 (diff) | |
download | rails-ca6d71753f3a2e8a0a29108b7c55ba3b7c8cd943.tar.gz rails-ca6d71753f3a2e8a0a29108b7c55ba3b7c8cd943.tar.bz2 rails-ca6d71753f3a2e8a0a29108b7c55ba3b7c8cd943.zip |
Deprecate allow_concurrency and make it have no effect
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb | 30 |
1 files changed, 11 insertions, 19 deletions
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 0910db1951..47fc11a620 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb @@ -14,25 +14,7 @@ module ActiveRecord # The connection handler cattr_accessor :connection_handler, :instance_writer => false - @@connection_handler = ConnectionAdapters::SingleThreadConnectionHandler.new - - # Turning on allow_concurrency changes the single threaded connection handler - # for a multiple threaded one, so that multi-threaded access of the - # connection pools is synchronized. - def self.allow_concurrency=(flag) - if @@allow_concurrency != flag - @@allow_concurrency = flag - # When switching connection handlers, preserve the existing pools so that - # #establish_connection doesn't need to be called again. - if @@allow_concurrency - self.connection_handler = ConnectionAdapters::MultipleThreadConnectionHandler.new( - self.connection_handler.connection_pools) - else - self.connection_handler = ConnectionAdapters::SingleThreadConnectionHandler.new( - self.connection_handler.connection_pools) - end - end - end + @@connection_handler = ConnectionAdapters::ConnectionHandler.new # Returns the connection currently associated with the class. This can # also be used to "borrow" the connection to do database work that isn't @@ -109,6 +91,16 @@ module ActiveRecord end class << self + # Deprecated and no longer has any effect. + def allow_concurrency + ActiveSupport::Deprecation.warn("ActiveRecord::Base.allow_concurrency has been deprecated and no longer has any effect. Please remove all references to allow_concurrency.") + end + + # Deprecated and no longer has any effect. + def allow_concurrency=(flag) + ActiveSupport::Deprecation.warn("ActiveRecord::Base.allow_concurrency= has been deprecated and no longer has any effect. Please remove all references to allow_concurrency=.") + end + # Returns the connection currently associated with the class. This can # also be used to "borrow" the connection to do database work unrelated # to any of the specific Active Records. |