Re: Cancelling idle in transaction state - Mailing list pgsql-hackers

From Kris Jurka
Subject Re: Cancelling idle in transaction state
Date
Msg-id alpine.BSO.2.00.0912300451440.4489@leary.csoft.net
Whole thread Raw
In response to Re: Cancelling idle in transaction state  (Simon Riggs <simon@2ndQuadrant.com>)
Responses Re: Cancelling idle in transaction state  (Simon Riggs <simon@2ndQuadrant.com>)
List pgsql-hackers

On Tue, 29 Dec 2009, Simon Riggs wrote:

>> The proposal is to send an additional NOTICE to the client and abort
>> all open transactions and subtransactions (this is what I got from the
>> previous discussion).
>
> Would this work with JDBC driver and/or general protocol clients?
>

A Notice would be easy to overlook.  The JDBC driver wraps that as a 
SQLWarning which callers need to explicitly check for (and rarely do in my 
experience).  So when they run their next statement they'll get an error 
saying that the current transaction is aborted, but they'll have no idea 
why as the warning was silently eaten.  I'd prefer the transaction 
cancellation to come as an Error because that's what it really is.

The only downside I can see is that a client would get confused if:

1) Transaction starts.
2) Idle transaction is killed and error message is given.
3) Client issues rollback
4) Client gets error message from saying the transaction was cancelled.

Kris Jurka


pgsql-hackers by date:

Previous
From: "Tarun Sharma"
Date:
Subject: solution to make static changes in pg_hba.conf file?
Next
From: Joachim Wieland
Date:
Subject: Re: Cancelling idle in transaction state