1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
Commit graph

22 commits

Author SHA1 Message Date
Jonathan Rochkind
cb6f839359 ConnectionPool wait_timeout no longer used for different types of timeouts. #6441
An AR ConnectionSpec `wait_timeout` is pre-patch used for three
different things:

* mysql2 uses it for MySQL's own wait_timeout (how long MySQL
  should allow an idle connection before closing it), and
  defaults to 2592000 seconds.
* ConnectionPool uses it for "number of seconds to block and
  wait for a connection before giving up and raising a timeout error",
  default 5 seconds.
* ConnectionPool uses it for the Reaper, for deciding if a 'dead'
  connection can be reaped. Default 5 seconds.

Previously, if you want to change these from defaults, you need
to change them all together. This is problematic _especially_
for the mysql2/ConnectionPool conflict, you will generally _not_
want them to be the same, as evidenced by their wildly different
defaults. This has caused real problems for people #6441 #2894

But as long as we're changing this, forcing renaming the
ConnectionPool key to be more specific, it made sense
to seperate the two ConnectionPool uses too -- these two
types of ConnectionPool timeouts ought to be able to be
changed independently, you won't neccesarily want them
to be the same, even though the defaults are (currently)
the same.
2012-05-23 12:08:11 -04:00
Jon Leighton
f06074f365 Fix CI 2011-12-28 23:08:40 +00:00
Arun Agrawal
de78c7e8e4 Removed test which works only < 1.9 2011-12-21 15:35:57 +05:30
Aaron Patterson
bd2f5c062d pushing caching and visitors down to the connection 2011-11-19 20:19:53 -08:00
Jeremy Kemper
999b7ed94d Transactional fixtures enlist all active database connections.
You can use multiple databases in your tests without disabling transactional fixtures.
2011-10-05 19:10:18 -07:00
Aaron Patterson
61774e0d49 please use ruby -I lib:test path/to/test.rb, or export RUBY_OPT 2011-06-06 15:47:13 -07:00
Jon Leighton
253bb6b926 Refactor Active Record test connection setup. Please see the RUNNING_UNIT_TESTS file for details, but essentially you can now configure things in test/config.yml. You can also run tests directly via the command line, e.g. ruby path/to/test.rb (no rake needed, uses default db connection from test/config.yml). This will help us fix the CI by enabling us to isolate the different Rails versions to different databases. 2011-06-04 23:47:03 +01:00
Xavier Noria
3b10b8a201 implements ActiveRecord::Base.connection_config to be able to check the configuration of the current connection at runtime 2011-03-05 01:35:02 +01:00
Jon Leighton
80df74bf51 Enable the sqlite3 in-memory test connection to work 2011-01-11 13:45:06 -08:00
Aaron Patterson
a4458f5d21 removing useless ternary 2010-08-19 10:46:10 -07:00
Neeraj Singh
0ef13afef5 expected value should come first in assert_equal
[#4630 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-18 16:13:00 +02:00
José Valim
dc2e291a93 Move AR logging responsibilities to ActiveRecord::Railties::Subscriber. 2010-01-13 01:19:23 +01:00
José Valim
cccb998800 Expose connections available in the connection pool. 2010-01-11 23:38:18 +01:00
Jeremy Kemper
77478f21af Resolve deadlock in pooled connections test 2009-11-10 11:00:29 -08:00
Nick Sieger
471a394215 Modify connection pool callbacks to be compatible w/ new style
Signed-off-by: Yehuda Katz <wycats@gmail.com>
2009-10-16 10:34:52 -07:00
steve
60a6284a46 Tests should use ActiveRecord::Base.connection.rollback_db_transaction to rollback a transaction
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-05-01 16:00:09 +01:00
steve
5501b99a19 Ensure ActiveRecord::Base.connection_pool.with_connection creates a new connection only when needed [#1752 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-05-01 14:58:10 +01:00
Amos King
db7daa04b8 Fix typo in pool_conections_test [#1350 state:committed]
Signed-off-by: David Heinemeier Hansson <david@loudthinking.com>
2008-11-14 11:54:05 +01:00
Jeremy Kemper
dd77733f2f Timeout the connection pool monitor on ruby 1.8 only 2008-11-08 00:27:18 -05:00
Pratik Naik
0832bc63f4 Make sure ActiveRecord::Base.connected? doesn't raise an exception for defined connections 2008-11-06 01:29:09 +05:30
Wes Oldenbeuving
32089cbcc9 Ensure ActiveRecord::ConnectionPool.connected? handles undefined connections. [#936 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2008-11-06 00:24:09 +05:30
Nick Sieger
d07a6b1a4a Make clear_active_connections! also return stale connections back to the pool
- also clean up some cruft remaining from per-thread connection cache
2008-08-29 14:12:12 -05:00