Re: idea to have driver return immediately after a query

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: <oliver(at)opencloud(dot)com>
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 16:46:08
Message-ID: 4D8F2380020000250003BCC1@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

> Oliver Jowett 03/27/11 9:10 AM >>>

> 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?

I guess we'd have to attach the SQLException object to the ResultSet
and throw it the next time the ResultSet was accessed. We could
debate about the fine points of whether there's a need to throw it if
next() isn't called again; I can see arguments on both sides of that.

[thinks some more]

Although -- if there is a transaction-killing exception, that's
something at the Connection level, so it would be proper to throw it
on any and every attempt to use the connection before the transaction
is reset, wouldn't it? Every ResultSet created within the context of
that transaction should fail, shouldn't it?

-Kevin

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kevin Grittner 2011-03-27 16:55:58 Re: JDBC gripe list
Previous Message Kevin Grittner 2011-03-27 16:37:26 Re: JDBC gripe list