X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 386D2DB689 for ; Tue, 1 Nov 2005 12:21:26 -0400 (AST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 40889-03 for ; Tue, 1 Nov 2005 16:21:25 +0000 (GMT) Received: from bedrock.cromagnon.com (170-215-19-8.dsl1.mnd.mn.frontiernet.net [170.215.19.8]) by svr1.postgresql.org (Postfix) with ESMTP id B16A8DB66A for ; Tue, 1 Nov 2005 12:21:24 -0400 (AST) Received: from lt-cservin.cdhps.com (cservin.dsl.visi.com [209.98.143.247]) (authenticated bits=0) by bedrock.cromagnon.com (8.12.8/8.12.8) with ESMTP id jA1GLLUE030459 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Tue, 1 Nov 2005 10:21:23 -0600 From: Craig Servin Organization: Cro-Magnon To: pgsql-jdbc@postgresql.org Subject: Re: Non-blocking SQL Execution Date: Tue, 1 Nov 2005 10:21:28 -0600 User-Agent: KMail/1.8.3 References: <85CE4E3FD2EC2C4E8AAE39916AC1A383090BA92A@ms07.mse2.exchange.ms> In-Reply-To: <85CE4E3FD2EC2C4E8AAE39916AC1A383090BA92A@ms07.mse2.exchange.ms> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200511011021.29170.cservin@cromagnon.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.055 required=5 tests=[AWL=0.055] X-Spam-Score: 0.055 X-Spam-Level: X-Archive-Number: 200511/2 X-Sequence-Number: 14100 If your using a 1.5 JDK a java.util.concurrent.FutureTask is a nice way to do this. On Monday 31 October 2005 06:57 pm, Logan Bowers wrote: > Ah yes, I like this strategy, it will actually make things easier in my > application for dealing with timeouts and such (since they can be > handled in the thread). Thanks! > > > > Logan Bowers > > > > ________________________________ > > From: Dave Cramer [mailto:pg@fastcrypt.com] > Sent: Monday, October 31, 2005 4:50 PM > To: Logan Bowers > Cc: pgsql-jdbc@postgresql.org > Subject: Re: [JDBC] Non-blocking SQL Execution > > > > It's probably easier to create a non-blocking thread which encapsulates > the driver > > > > And yes, the postgres driver blocks on the execute. > > > > Dave > > On 31-Oct-05, at 7:06 PM, Logan Bowers wrote: > > > > > > Hello, > > > > (sorry if this comes through twice) > > > > I'm running a web application that needs to run several queries against > several databases > > to satisfy a single request. To minimize latency I'd like to be able to > issue > > ".executeQuery()" on each connection, allow > the servers to > > execute the queries in parallel, and then only block when I attempt to > fetch the first > > row. > > > > My anecdotal experience with JDBC drivers in general are that they block > when you attempt > > to execute the query, not when you attempt to retrieve data. Is this > the case for the > > Postgres driver? Does anyone have a feel for how hard it would be to > modify the driver > > allow queries to be executed in the background? Thanks! > > > > Logan Bowers