I'm using Sequel, not ActiveRecord. So the latter. This is my intended mailing list.
But speaking of ActiveRecord and ConnectionPools, it looks like that would do what I want. (http://api.rubyonrails.org/files/activerecord/lib/active_record/connection_adapters/abstract/connection_pool_rb.html) So it's fair to say there's no connection pool in Sequel. On Wednesday, March 26, 2014 10:46:54 PM UTC-7, Christian MICHON wrote: > > Is this question related to active record or sequel? > > If it's the former, you're on the wrong mailing list... > On Mar 27, 2014 6:33 AM, "Jeff" <[email protected] <javascript:>> wrote: > >> I have a Rails app that makes connections to other DBs. There may be >> multiple users connecting to multiple DBs. >> >> The app makes a database connection as part of an action. However, I >> noticed a problem: there's too many DB connections remaining open, which is >> causing the DB to not have enough connections remaining for new >> connections. (psql: FATAL: remaining connection slots are reserved for >> non-replication superuser connections) >> >> So I should manually call disconnect to disconnect connections. That's >> fair enough. >> >> However, is there a better way, maybe some way to persist a DB connection >> through the app unless it wasn't used in the last 5 minutes? Rather than >> re-opening DB connections with each action and each user, it'd be more >> efficient to keep the DB connection open and share it amongst users and >> requests, but automatically disconnect if it hasn't been called in the last >> few minutes. >> >> In Python I think you can use pickling for this purpose. Maybe. >> >> Can anyone suggest a good way to do this with Ruby on Rails? Or share >> sample code? >> >> Thanks. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "sequel-talk" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> To post to this group, send email to [email protected]<javascript:> >> . >> Visit this group at http://groups.google.com/group/sequel-talk. >> For more options, visit https://groups.google.com/d/optout. >> > -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sequel-talk. For more options, visit https://groups.google.com/d/optout.
