bdurand / seamless_database_pool

Add support for master/slave database clusters in ActiveRecord to improve performance.
http://rdoc.info/projects/bdurand/seamless_database_pool
MIT License
224 stars 58 forks source link

Rails 3 support #1

Closed wbharding closed 13 years ago

wbharding commented 13 years ago

Hey there,

Love the SDP gem, but noticed there were a couple issues getting it fully functional with Rails 3 in controllers. This commit fixes that and gets it fully Rails 3 compliant.

Bill

bdurand commented 13 years ago

I finally got around to pulling your code. I had to make some changes to get the tests to pass. Specifically:

  1. Changed logging to use the logger set on the connection adapter rather than Rails.logger
  2. Removed code to take failing connections out of the pool and to revert the pool to use the master connection when all else fails. The code is designed so that the master connection should usually be in the read pool and to recover on its own.
  3. Made sure the controller filter changes are still backward compatible with Rails 2.

Thanks for the commits and please let me know if the changes I made still satisfy the issues you had.