Skip site navigation (1) Skip section navigation (2)

Re: statement caching proof of concept

From: till toenges <tt(at)kyon(dot)de>
To: Dave Cramer <pg(at)fastcrypt(dot)com>
Cc: List <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: statement caching proof of concept
Date: 2006-06-19 23:56:55
Message-ID: 449739C7.2070303@kyon.de (view raw or flat)
Thread:
Lists: pgsql-jdbc
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

In response to

Responses

pgsql-jdbc by date

Next:From: Dave CramerDate: 2006-06-19 23:59:20
Subject: Re: statement caching proof of concept
Previous:From: Mark LewisDate: 2006-06-19 23:51:59
Subject: Re: statement caching proof of concept

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group