Forum: Ruby on Rails How do I close DB connections?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Df809220e0bdddc3d1e92e4c31111d18?d=identicon&s=25 Chris Miller (chrism71)
on 2005-12-20 18:24
My Rails App makes quite a few calls (all different queries)
to our Postgres DB. Each time I make a find_by_sql method call,
a connection opens and then stays idle. Of course, after 500
or so of these idle postgres processes running, the DB refuses
to let me make any more (and I can't really add more to the
postgres.conf).

How do I make sure these connections get closed after each query?

I'm guessing it has something to do with remove_connection?
821395fe70906c8290df7f18ac4ac6cf?d=identicon&s=25 Rick Olson (Guest)
on 2005-12-20 19:46
(Received via mailing list)
On 12/20/05, Chris Miller <chrism@cjmiller.net> wrote:
> My Rails App makes quite a few calls (all different queries)
> to our Postgres DB. Each time I make a find_by_sql method call,
> a connection opens and then stays idle. Of course, after 500
> or so of these idle postgres processes running, the DB refuses
> to let me make any more (and I can't really add more to the
> postgres.conf).
>
> How do I make sure these connections get closed after each query?
>
> I'm guessing it has something to do with remove_connection?

I'd post a ticket with some details about your ruby/rails/psql
environment.


--
rick
http://techno-weenie.net
This topic is locked and can not be replied to.