From: Guillaume Smet <guillaume.smet@gmail.com>
To: Dave Cramer <davec@postgresintl.com>
To: PostgreSQL JDBC <pgsql-jdbc@postgresql.org>
Cc: thierry.buffet@fr.nurun.com
Subject: Re: Memory leaks using refcursors
Date: Thu, 18 Jan 2007 15:46:26 +0100
Message-ID: <1d4e0c10701180646p56c18dcal2cb3526bd1050e63@mail.gmail.com> (raw)
In-Reply-To: <1E6DB692-8D5A-493F-9E1F-82130917EE77@postgresintl.com>
References: <1d4e0c10701171053t55e60a2epf3e395b5b97101b5@mail.gmail.com>
<1d4e0c10701171422u2e9d8758ia663dd1f826f8258@mail.gmail.com>
<6135.1169073075@sss.pgh.pa.us>
<1d4e0c10701171527u744fd81eh6de7908599349af3@mail.gmail.com>
<C8C31B9B-ABE7-41D6-AB6C-F03B2C11D038@postgresintl.com>
<1d4e0c10701180057s2c2e4c85g50998c883bb470df@mail.gmail.com>
<1E6DB692-8D5A-493F-9E1F-82130917EE77@postgresintl.com>
Hi all,
Summary of our discussion with Dave on IRC.
The following patch provided by Dave fixed the problem for the first
31 iterations of our test but failed after that because the garbage
collector calls the close() method a second time when the object is
dereferenced (finalize() method of AbstractJDBC2Statement). So we have
to be sure that when the close() method is called a second time, it
doesn't fail.
On 1/18/07, Dave Cramer <davec@postgresintl.com> wrote:
> +
> + if ( this.refCursorName != null )
> + {
> + connection.execSQLUpdate("close \"" + refCursorName +'"');
I added a refCursorName = null; here to be sure the close cursor is
not executed twice and it works correctly.
> + }
I don't have the memory leaks anymore. I'll ask the people developing
the real application to test this patch to be sure everything is now
OK and I'll post the confirmation here.
Dave, thanks a lot for your help.
--
Guillaume
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: guillaume.smet@gmail.com, davec@postgresintl.com, thierry.buffet@fr.nurun.com
Subject: Re: Memory leaks using refcursors
In-Reply-To: <1d4e0c10701180646p56c18dcal2cb3526bd1050e63@mail.gmail.com>
References: <1d4e0c10701171053t55e60a2epf3e395b5b97101b5@mail.gmail.com> <1d4e0c10701171422u2e9d8758ia663dd1f826f8258@mail.gmail.com> <6135.1169073075@sss.pgh.pa.us> <1d4e0c10701171527u744fd81eh6de7908599349af3@mail.gmail.com> <C8C31B9B-ABE7-41D6-AB6C-F03B2C11D038@postgresintl.com> <1d4e0c10701180057s2c2e4c85g50998c883bb470df@mail.gmail.com> <1E6DB692-8D5A-493F-9E1F-82130917EE77@postgresintl.com> <1d4e0c10701180646p56c18dcal2cb3526bd1050e63@mail.gmail.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