pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliver Jowett <oliver@opencloud.com>
To: Paul Lindner <lindner@inuus.com>
Cc: Josh Berkus <josh@agliodbs.com>
Cc: Heikki Linnakangas <heikki@enterprisedb.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Prepared Statements vs. pgbouncer
Date: Tue, 02 Oct 2007 10:19:56 +1300
Message-ID: <4701647C.8050305@opencloud.com> (raw)
In-Reply-To: <470160C0.6020907@opencloud.com>
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>

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



view thread (48+ messages)  latest in thread

Message-ID: <4701647C.8050305@opencloud.com>
Permalink:  ../4701647C.8050305@opencloud.com/
Also on:    postgresql.org/message-id/4701647C.8050305@opencloud.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: oliver@opencloud.com, lindner@inuus.com, josh@agliodbs.com, heikki@enterprisedb.com
  Subject: Re: Prepared Statements vs. pgbouncer
  In-Reply-To: <4701647C.8050305@opencloud.com>
  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> <4701647C.8050305@opencloud.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox