Re: statement caching proof of concept - Mailing list pgsql-jdbc

From Dave Cramer
Subject Re: statement caching proof of concept
Date
Msg-id 43EC5E93-607B-46C5-A133-00CE2E58F523@fastcrypt.com
Whole thread Raw
In response to Re: statement caching proof of concept  (till toenges <tt@kyon.de>)
List pgsql-jdbc
Till,

Thanks, this is a great example. So how would any caching
implementation deal with this?

I can think of copying the result set into the wrapper, but that
could be prohibitively expensive.

Dave
On 19-Jun-06, at 7:56 PM, till toenges wrote:

> Dave Cramer wrote:
>> AFAIK Postgres doesn't allow concurrent statements on the same
>> connection, so I don't see how using multiple threads would work ?
>
> The statements wouldn't need to be concurrent in the sense of
> happening
> at the same time:
>
> // stupid query
> String sql = "SELECT * FROM quicklychangingtable";
> PreparedStatement p1 = connection.prepareStatement(sql);
> PreparedStatement p2 = connection.prepareStatement(sql);
> ResultSet r1 = p1.executeQuery();
> // do something else for a while
> ResultSet r2 = p2.executeQuery();
>
> What happens with r1? Might be ok, but i'm not sure if this is
> always true.
>
>
> Till
>


pgsql-jdbc by date:

Previous
From: till toenges
Date:
Subject: Re: statement caching proof of concept
Next
From: till toenges
Date:
Subject: Re: statement caching proof of concept