Re: Allow pooled connections to list all prepared queries

From: Kris Jurka <books(at)ejurka(dot)com>
To: David Brown <dave(at)spoonguard(dot)org>
Cc: PostgreSQL Global Development Group <pgsql-patches(at)postgresql(dot)org>, Charlie Peck <charliep(at)cs(dot)earlham(dot)edu>
Subject: Re: Allow pooled connections to list all prepared queries
Date: 2004-12-27 18:03:08
Message-ID: Pine.BSO.4.56.0412271253540.992@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

On Sat, 25 Dec 2004, David Brown wrote:

> You're right, in the case of standalone Perl or Apache::DBI. However, if
> DBD::Pg happens to grab an already-open connection that doesn't have a
> one-to-one correspondence with a $dbh (e.g. from a Postgres connection pool,
> or from an external pooling server like DBBalancer[1]), the state of the
> connection (with respect to past PREPAREs) isn't known.
>

I'm not clear why the pooling case is different. Speaking from the JDBC
side (which does connection pooling, but not statement pooling) there is
a proxy connection object which wraps a real connection. So each new
connection from the pool gets a new proxy object, but the real underlying
connection stays the same. So the real connection will know what it has
or has not prepared. So I don't see why, simply because it's in a pool,
that it forgets what's been prepared.

Kris Jurka

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message David Brown 2004-12-27 19:12:20 Re: Allow pooled connections to list all prepared queries
Previous Message Hans-Juergen Schoenig 2004-12-27 10:31:53 Implementing SELECT FOR UPDATE [NOWAIT]