Skip site navigation (1) Skip section navigation (2)

Re: Statement.cancel() race condition

From: Kris Jurka <books(at)ejurka(dot)com>
To: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Statement.cancel() race condition
Date: 2005-12-02 03:13:53
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-jdbc

On Thu, 1 Dec 2005, Kris Jurka wrote:

> 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:
> 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.

I've applied this fix for single threaded applications to 8.0, 8.1 and 
HEAD.  The multi-threaded stuff is more complicated than I'd like to get 
into at the moment.

Kris Jurka

In response to

pgsql-jdbc by date

Next:From: NosyManDate: 2005-12-02 09:42:38
Subject: jdbc and ARRAYs
Previous:From: Kris JurkaDate: 2005-12-01 23:39:15
Subject: Re: Statement.cancel() race condition

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group