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 40F23DB572 for ; Mon, 31 Oct 2005 20:49:44 -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 32638-03 for ; Tue, 1 Nov 2005 00:49:39 +0000 (GMT) Received: from net2.micro-automation.com (net2.micro-automation.com [64.7.141.29]) by svr1.postgresql.org (Postfix) with SMTP id A84B4DB479 for ; Mon, 31 Oct 2005 20:49:40 -0400 (AST) Received: (qmail 21256 invoked from network); 1 Nov 2005 00:49:43 -0000 Received: from dcdsl.ebox.com (HELO ?192.168.1.2?) (davec@64.7.143.116) by net2.micro-automation.com with SMTP; 1 Nov 2005 00:49:43 -0000 In-Reply-To: <85CE4E3FD2EC2C4E8AAE39916AC1A383090BA842@ms07.mse2.exchange.ms> References: <85CE4E3FD2EC2C4E8AAE39916AC1A383090BA842@ms07.mse2.exchange.ms> Mime-Version: 1.0 (Apple Message framework v734) Content-Type: multipart/alternative; boundary=Apple-Mail-48-27643475 Message-Id: Cc: From: Dave Cramer Subject: Re: Non-blocking SQL Execution Date: Mon, 31 Oct 2005 19:49:42 -0500 To: Logan Bowers X-Mailer: Apple Mail (2.734) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.022 required=5 tests=[AWL=0.021, HTML_MESSAGE=0.001] X-Spam-Score: 0.022 X-Spam-Level: X-Archive-Number: 200510/165 X-Sequence-Number: 14096 --Apple-Mail-48-27643475 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed 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 > > > > --Apple-Mail-48-27643475 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=ISO-8859-1 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)=A0

I'm running a web application that needs to run = several queries against several databases

to satisfy a single request.=A0 To minimize = latency I'd like to be able to issue

"<PreparedStatement = Object>.executeQuery()" on each connection, allow the servers = toexecute the queries = in parallel, and then only block when I attempt to fetch the = firstrow.=A0

My anecdotal experience with JDBC drivers in = general are that they block when you attemptto execute the = query, not when you attempt to retrieve data.=A0 Is this the case for = thePostgres driver?=A0 = Does anyone have a feel for how hard it would be to modify the = driverallow queries to be = executed in the background?=A0 Thanks!

=A0

= Bowers


= --Apple-Mail-48-27643475--