Received: from localhost (unknown [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 2CE289FA036 for ; Mon, 1 Oct 2007 18:20:15 -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 14907-04 for ; Mon, 1 Oct 2007 18:20:00 -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 BB6B89F9C2A for ; Mon, 1 Oct 2007 18:19:59 -0300 (ADT) Received: from 222-154-155-16.jetstream.xtra.co.nz ([222.154.155.16] 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 1IcSgD-0004JL-Hs; Tue, 02 Oct 2007 10:19:53 +1300 Message-ID: <4701647C.8050305@opencloud.com> Date: Tue, 02 Oct 2007 10:19:56 +1300 From: Oliver Jowett User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 To: Paul Lindner CC: Josh Berkus , Heikki Linnakangas , pgsql-jdbc@postgresql.org Subject: Re: Prepared Statements vs. pgbouncer References: <24584.1191033096@sss.pgh.pa.us> <4701402A.2020804@agliodbs.com> <20071001193153.GN3140@inuus.com> <200710011249.19142.josh@agliodbs.com> <20071001203432.GO3140@inuus.com> <470160C0.6020907@opencloud.com> In-Reply-To: <470160C0.6020907@opencloud.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: 200710/28 X-Sequence-Number: 17600 Oliver Jowett wrote: > Paul Lindner wrote: > >> Why doesn't the Postgres JDBC driver use cursors for ResultSets >> instead of creating prepared statements? Is this not supported in the >> v3 protocol? (I'd answer this question myself, but no time to read >> code at the moment...) > > It uses portals which are the v3 equivalent of cursors. To elaborate a bit more: you need a statement before you can create a portal, and the unnamed statement is no use for this particular case as we need the portal to live despite reuse of the unnamed statement, and the implicit close of the unnamed statement on reuse also causes any dependant portal to close. So we must use a named statement so that we can control the lifetime of the portal correctly. -O