Received: from localhost (unknown [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 92D819F9EC7 for ; Fri, 28 Sep 2007 22:06:11 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 30764-04 for ; Fri, 28 Sep 2007 22:06:08 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from tremor.opencloud.co.nz (tremor.opencloud.co.nz [131.203.101.230]) by postgresql.org (Postfix) with ESMTP id 1E6069FA0A5 for ; Fri, 28 Sep 2007 22:06:07 -0300 (ADT) Received: from 222-154-147-224.jetstream.xtra.co.nz ([222.154.147.224] helo=[10.1.1.3]) by tremor.opencloud.co.nz with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1IbQmO-0001lV-NK; Sat, 29 Sep 2007 13:06:00 +1200 Message-ID: <46FDA4F2.8080507@opencloud.com> Date: Sat, 29 Sep 2007 13:05:54 +1200 From: Oliver Jowett User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 To: Paul Lindner CC: pgsql-jdbc@postgresql.org Subject: Re: Prepared Statements vs. pgbouncer References: <20070929002513.GG3140@inuus.com> In-Reply-To: <20070929002513.GG3140@inuus.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200709/131 X-Sequence-Number: 17553 Paul Lindner wrote: > the assumption of a singular > client->server backend is causing this problem. Well, yes, that's fairly fundamental to the client-server protocol. It sounds like pgbouncer is breaking the protocol. You could perhaps do transparent statement/portal renaming in pgbouncer but that seems to be only scratching the surface of the problem. Consider your case here: > * Client A creates statement S_1, fetches results. > When finished the statement is put in a cleanup queue. > * time passes > * pgbouncer notices that client A is idle and reassigns backend to > client B Ok, now client A wakes up and wants to reuse S_1. What happens? The backend that knows about S_1 is currently in use by B. Changing the JDBC driver to handle a "server" that doesn't follow the documented server protocol seems a bit backwards. I think you're going to have to teach pgbouncer a whole lot more about statements and portals to get this one working. -O