Re: closing statements when connection is closed

From: Dave Cramer <pg(at)fastcrypt(dot)com>
To: Iain <iain(at)mst(dot)co(dot)jp>
Cc: "pgsql-jdbc(at)postgresql(dot)org" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: closing statements when connection is closed
Date: 2004-02-12 04:22:16
Message-ID: 1076559735.1641.67.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Iain,

It's really the connections statements I am trying to clean up, but yes
you do need to close the connection if that is how the pool expects them
returned, or otherwise return them to the pool.

If everyone were as diligent as your programmers, writing drivers would
be easy, alas, they aren't :(

Dave
On Wed, 2004-02-11 at 20:30, Iain wrote:
> I've never used connection pooling so bear that in mind... connection
> pooling is best suited for situations where there are many clients that use
> the DB for short, well defined requests with lots of idle time inbetween
> (that's what the book I read said anyway). Intuitively, a connection pool is
> just mimicing a DB to the client anyway, so if you don't explicitly close
> connections in your own code, how can your connection be returned to the
> pool (assuming the process doesn't terminate)?
>
> No matter what the standard or implementation document says about it's
> management of connections, I would still require my programmers to
> explicitly close connections when the application is fnished with them. It's
> simply good programming practice, and at least that way, if a problem with
> connection memory leakage occurs you can blame someone else.
>
> If I missed the point here, I stand ready to be educated.
> Regards,
> Iain
>
> > >> In the JDBC API Tutorial and Reference, it suggests that driver
> > >> implementors assume the worst, so I think that we should attempt to
> > >> clean up our clients connections as best we can.
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faqs/FAQ.html
>
--
Dave Cramer
519 939 0336
ICQ # 14675561

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Oliver Jowett 2004-02-12 05:15:12 Re: closing statements when connection is closed
Previous Message Iain 2004-02-12 01:30:27 Re: closing statements when connection is closed