Re: Statement.cancel() race condition - Mailing list pgsql-jdbc

From Kris Jurka
Subject Re: Statement.cancel() race condition
Date
Msg-id Pine.BSO.4.61.0512011833110.24595@leary.csoft.net
Whole thread Raw
In response to Statement.cancel() race condition  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Responses Re: Statement.cancel() race condition
List pgsql-jdbc

On Thu, 1 Dec 2005, Kevin Grittner wrote:

>
> The problem is that even after the exception comes out of this code, is
> caught, and the transaction is rolled back -- we are still often able to
> start another statement which is running by the time the server gets
> around to interrupting the related back end process.  Obviously, having
> the cancel of one statement actually interrupt the processing of a
> subsequent statement violates the popular principle of "least surprising
> result".
>

I think taking the ReceiveEOF portion of this patch:

http://archives.postgresql.org/pgsql-jdbc/2003-09/msg00175.php

would fix this in the single thread case.  The multi-threaded case is
obviously more complicated.  I don't recall why the original patch wasn't
committed.

Kris Jurka

pgsql-jdbc by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Statement.cancel() race condition
Next
From: Kris Jurka
Date:
Subject: Re: Statement.cancel() race condition