Re: idea to have driver return immediately after a query

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>
Cc: pg(at)fastcrypt(dot)com, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: idea to have driver return immediately after a query
Date: 2011-03-27 14:10:07
Message-ID: AANLkTimT7gt2dtwmsr_WSuUCuRVpyvo5FpigCjHU1mi6@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On 28 March 2011 02:42, Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov> wrote:
> Oliver Jowett  wrote:
>> I'm a little worried about error handling too.
>
> Any code written for portability would deal with it, since most
> drivers stream the results and can throw exceptions on next().  (It
> is declared to throw that in the interface, after all.)

Sure, we do that too already when a fetchsize is set.
I was more worried about problems similar to this:

ResultSet rs1 = statement1.executeQuery();
// send Parse, Bind, Execute
// process parse, bind responses (all OK)
// return control to the caller
ResultSet rs2 = statement2.executeQuery();
// need to read statement1's pending results first
// oops - actually, statement1's query deadlocked, how do we
report that error sensibly?

If we don't ensure that the connection is in an idle state when we
return control to the caller, it's going to be hard to report errors
in the right context.

Oliver

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Oliver Jowett 2011-03-27 14:15:18 Re: JDBC gripe list
Previous Message Kevin Grittner 2011-03-27 13:42:18 Re: idea to have driver return immediately after a query