diff options
author | Nick Sieger <nick@nicksieger.com> | 2008-08-22 13:45:10 -0500 |
---|---|---|
committer | Nick Sieger <nick@nicksieger.com> | 2008-08-29 14:12:12 -0500 |
commit | 212134dce158db0ecb4169c28fd9ef80ea1a55b2 (patch) | |
tree | f9028fe87def283d1fd46dd457015eae465842d5 /activerecord/test/cases | |
parent | ca6d71753f3a2e8a0a29108b7c55ba3b7c8cd943 (diff) | |
download | rails-212134dce158db0ecb4169c28fd9ef80ea1a55b2.tar.gz rails-212134dce158db0ecb4169c28fd9ef80ea1a55b2.tar.bz2 rails-212134dce158db0ecb4169c28fd9ef80ea1a55b2.zip |
Remove CachedConnectionPerThread per-thread pooling mechanism in favor of a fixed pool with default maximum of 5 connections
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/locking_test.rb | 2 | ||||
-rw-r--r-- | activerecord/test/cases/threaded_connections_test.rb | 2 | ||||
-rw-r--r-- | activerecord/test/cases/transactions_test.rb | 3 |
3 files changed, 7 insertions, 0 deletions
diff --git a/activerecord/test/cases/locking_test.rb b/activerecord/test/cases/locking_test.rb index bbe8582466..df9829195c 100644 --- a/activerecord/test/cases/locking_test.rb +++ b/activerecord/test/cases/locking_test.rb @@ -280,6 +280,7 @@ unless current_adapter?(:SQLServerAdapter, :SybaseAdapter, :OpenBaseAdapter) sleep zzz # block thread 2 for zzz seconds end t1 = Time.now + Person.clear_active_connections! end b = Thread.new do @@ -287,6 +288,7 @@ unless current_adapter?(:SQLServerAdapter, :SybaseAdapter, :OpenBaseAdapter) t2 = Time.now Person.transaction { yield } t3 = Time.now + Person.clear_active_connections! end a.join diff --git a/activerecord/test/cases/threaded_connections_test.rb b/activerecord/test/cases/threaded_connections_test.rb index 7246a8a62b..54c1470e69 100644 --- a/activerecord/test/cases/threaded_connections_test.rb +++ b/activerecord/test/cases/threaded_connections_test.rb @@ -16,12 +16,14 @@ unless %w(FrontBase).include? ActiveRecord::Base.connection.adapter_name class PooledConnectionsTest < ActiveRecord::TestCase def setup + super @connection = ActiveRecord::Base.remove_connection end def teardown ActiveRecord::Base.clear_all_connections! ActiveRecord::Base.establish_connection(@connection) + super end def checkout_connections diff --git a/activerecord/test/cases/transactions_test.rb b/activerecord/test/cases/transactions_test.rb index 8383ba58e9..d3cc69507a 100644 --- a/activerecord/test/cases/transactions_test.rb +++ b/activerecord/test/cases/transactions_test.rb @@ -296,6 +296,7 @@ if current_adapter?(:PostgreSQLAdapter) topic.approved = !topic.approved? topic.save! end + Topic.clear_active_connections! end end @@ -331,6 +332,7 @@ if current_adapter?(:PostgreSQLAdapter) dev = Developer.find(1) assert_equal original_salary, dev.salary end + Developer.clear_active_connections! end end @@ -342,6 +344,7 @@ if current_adapter?(:PostgreSQLAdapter) # Always expect original salary. assert_equal original_salary, Developer.find(1).salary end + Developer.clear_active_connections! end end |