pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dave Cramer <pg@fastcrypt.com>
To: till toenges <tt@kyon.de>
Cc: List <pgsql-jdbc@postgresql.org>
Subject: Re: statement caching proof of concept
Date: Mon, 19 Jun 2006 19:59:20 -0400
Message-ID: <43EC5E93-607B-46C5-A133-00CE2E58F523@fastcrypt.com> (raw)
In-Reply-To: <449739C7.2070303@kyon.de>
References: <4077BF73-482B-46C8-B65D-2E1FD2465294@fastcrypt.com>
	<4496F396.8030408@kyon.de>
	<5A43640B-3C41-4D07-AA9E-588AD8AAD343@fastcrypt.com>
	<44972AF1.1020009@kyon.de>
	<D6688629-8E73-4BA2-9FB7-EEE2761E16F9@fastcrypt.com>
	<449739C7.2070303@kyon.de>

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
>




view thread (18+ messages)  latest in thread

Message-ID: <43EC5E93-607B-46C5-A133-00CE2E58F523@fastcrypt.com>
Permalink:  ../43EC5E93-607B-46C5-A133-00CE2E58F523@fastcrypt.com/
Also on:    postgresql.org/message-id/43EC5E93-607B-46C5-A133-00CE2E58F523@fastcrypt.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: pg@fastcrypt.com, tt@kyon.de
  Subject: Re: statement caching proof of concept
  In-Reply-To: <43EC5E93-607B-46C5-A133-00CE2E58F523@fastcrypt.com>
  References: <4077BF73-482B-46C8-B65D-2E1FD2465294@fastcrypt.com> <4496F396.8030408@kyon.de> <5A43640B-3C41-4D07-AA9E-588AD8AAD343@fastcrypt.com> <44972AF1.1020009@kyon.de> <D6688629-8E73-4BA2-9FB7-EEE2761E16F9@fastcrypt.com> <449739C7.2070303@kyon.de> <43EC5E93-607B-46C5-A133-00CE2E58F523@fastcrypt.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