From: Kris Jurka <books@ejurka.com>
To: Dave Crooke <dcrooke@gmail.com>
Cc: Scott Carey <scott@richrelevance.com>
Cc: pgsql-performance <pgsql-performance@postgresql.org>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: SOLVED ... Re: Getting rid of a cursor from JDBC .... Re: [PERFORM] Re: HELP: How to tame the 8.3.x JDBC driver with a biq guery result set
Date: Tue, 20 Apr 2010 12:07:48 -0400 (EDT)
Message-ID: <alpine.BSO.2.00.1004201157210.17732@leary.csoft.net> (raw)
In-Reply-To: <q2sca24673e1004191633j10b1124amf1eb51f3bd84f19a@mail.gmail.com>
References: <q2sca24673e1004191633j10b1124amf1eb51f3bd84f19a@mail.gmail.com>
On Mon, 19 Apr 2010, Dave Crooke wrote:
> Statement.close() appears to get the job done (in my envrionment, PG's
> driver never sees a Connection.close() because of DBCP).
>
> I'd consider the fact that ResultSet.close() does not release the implicit
> cursor to be something of a bug, but it may well have been fixed already.
PG doesn't release the locks acquired by the query until transaction end.
So closing a cursor will release some backend memory, but it won't release
the locks. The way the driver implements ResultSet.close() is to put
the close message into a queue so that the next time a message is sent to
the backend we'll also send the cursor close message. This avoids an
extra network roundtrip for the close action.
In any case Statement.close isn't helping you here either. It's really
Connection.commit/rollback that's releasing the locks.
Kris Jurka
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-performance@postgresql.org
Cc: books@ejurka.com, dcrooke@gmail.com, scott@richrelevance.com, pgsql-jdbc@postgresql.org
Subject: Re: SOLVED ... Re: Getting rid of a cursor from JDBC .... Re: [PERFORM] Re: HELP: How to tame the 8.3.x JDBC driver with a biq guery result set
In-Reply-To: <alpine.BSO.2.00.1004201157210.17732@leary.csoft.net>
References: <q2sca24673e1004191633j10b1124amf1eb51f3bd84f19a@mail.gmail.com> <alpine.BSO.2.00.1004201157210.17732@leary.csoft.net>
* 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