Re: Cancelling idle in transaction state

From: Kris Jurka <books(at)ejurka(dot)com>
To: Simon Riggs <simon(at)2ndQuadrant(dot)com>
Cc: Joachim Wieland <joe(at)mcknight(dot)de>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Hannu Krosing <hannu(at)2ndquadrant(dot)com>, James Pye <lists(at)jwp(dot)name>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Cancelling idle in transaction state
Date: 2009-12-30 10:02:44
Message-ID: alpine.BSO.2.00.0912300451440.4489@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joachim Wieland 2009-12-30 10:43:08 Re: Cancelling idle in transaction state
Previous Message Tarun Sharma 2009-12-30 09:23:49 solution to make static changes in pg_hba.conf file?