From: Oliver Jowett <oliver@opencloud.com>
To: Dave Cramer <pg@fastcrypt.com>
Cc: List <pgsql-jdbc@postgresql.org>
Subject: Re: statement caching proof of concept
Date: Tue, 20 Jun 2006 19:00:31 +0900
Message-ID: <4497C73F.7040804@opencloud.com> (raw)
In-Reply-To: <4497C527.6090608@opencloud.com>
References: <4077BF73-482B-46C8-B65D-2E1FD2465294@fastcrypt.com>
<44973024.4010204@opencloud.com>
<BCA6670E-411A-40B0-9331-51EDC6B7A44E@fastcrypt.com>
<4497C527.6090608@opencloud.com>
Oliver Jowett wrote:
> Dave Cramer wrote:
>>
>> On 19-Jun-06, at 7:15 PM, Oliver Jowett wrote:
>>>
>>> The "wrapper" implementation approach suffers from the usual
>>> difficulty that the "back links" such as ResultSet.getStatement()
>>> point to the wrong object. It's actually quite a bit of work to get
>>> this right..
>> Since result sets only live as long as the statement, wouldn't they
>> point to the statement that is still open ?
>
> What I mean is that this won't work:
>
> PreparedStatement ps = conn.prepareStatement(...);
> ResultSet rs = ps.executeQuery();
> assert rs.getStatement() == ps;
>
> since rs.getStatement() will return the real underlying statement, not
> the wrapper that prepareStatement() creates.
Oh, never mind, I didn't look at the code closely enough, you're
returning the real statement not a wrapper. (that has some other
problems with badly-behaved code as others have noted)
-O
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, pg@fastcrypt.com
Subject: Re: statement caching proof of concept
In-Reply-To: <4497C73F.7040804@opencloud.com>
References: <4077BF73-482B-46C8-B65D-2E1FD2465294@fastcrypt.com> <44973024.4010204@opencloud.com> <BCA6670E-411A-40B0-9331-51EDC6B7A44E@fastcrypt.com> <4497C527.6090608@opencloud.com> <4497C73F.7040804@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