How do I close DB connections?


#1

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?


#2

On 12/20/05, Chris M. removed_email_address@domain.invalid 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