X-Original-To: pgsql-jdbc-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 4CF6A9F9316 for ; Mon, 19 Jun 2006 20:54:58 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 19147-01 for ; Mon, 19 Jun 2006 20:54:48 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from jcour.kyon.de (www.ky-on.de [213.9.98.91]) by postgresql.org (Postfix) with ESMTP id B69129F9F2D for ; Mon, 19 Jun 2006 20:54:48 -0300 (ADT) Received: from [10.0.4.2] (gw-cust1497.hkn.net [213.9.96.234]) (AUTH: LOGIN tt, ) by jcour.kyon.de with esmtp; Tue, 20 Jun 2006 01:54:47 +0200 Message-ID: <449739C7.2070303@kyon.de> Date: Tue, 20 Jun 2006 01:56:55 +0200 From: till toenges User-Agent: Thunderbird 1.5.0.4 (Macintosh/20060530) MIME-Version: 1.0 To: Dave Cramer CC: List Subject: Re: statement caching proof of concept References: <4077BF73-482B-46C8-B65D-2E1FD2465294@fastcrypt.com> <4496F396.8030408@kyon.de> <5A43640B-3C41-4D07-AA9E-588AD8AAD343@fastcrypt.com> <44972AF1.1020009@kyon.de> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/63 X-Sequence-Number: 15343 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