I was dealing with some "personal" problems in my work app tonight and noticed that the establish_connection method creates pools for the calling class vs the name of the connection in database.yml. My app is rather large and a number of models connect to an alternate database. This means that said connection, if left at the default pool size of 5, will have 5 times the number of models that call that establish_connection to it. In my app that was a pretty hefty number, around 10-15 models.
Is there any interest in reviewing a patch that would change this so that connection pools are keyed off the name of the connection in database.yml? Perhaps another alternative? For now I am thinking of making a base connection class and just having the 10-15 models in my app subclass from that vs ActiveRecord::Base. Feedback very much appreciated.
- Thanks, Ken