How do I close DB connections?

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?

On 12/20/05, Chris M. [email protected] 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 forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs