Re: display previous query string of idle-in-transaction - Mailing list pgsql-hackers

From Guillaume Smet
Subject Re: display previous query string of idle-in-transaction
Date
Msg-id 1d4e0c10903270257v5f0f2fdev6b742066e13fd974@mail.gmail.com
Whole thread Raw
In response to Re: display previous query string of idle-in-transaction  (Simon Riggs <simon@2ndQuadrant.com>)
List pgsql-hackers
On Fri, Mar 27, 2009 at 9:07 AM, Simon Riggs <simon@2ndquadrant.com> wrote:
> Or take it further back still and think about why "idle in transaction"
> occurs at all and fix *that*. Maybe not in Postgres at all, possibly in
> the driver or even higher up client stack.

From my experience, the main reasons for this problem are:
- a poorly coded connection pool (a lot of people think they really
should write their connection pooling solution themselves...);
- a poorly coded application;
- bugs in the code.

So you really should try to fix them in your application first.

That said, I have one case in mind where I wasn't able to fix
completely the connection pool and the application and we still
encounter idle in transaction connections from time to time.

For this sort of case, a timeout would be a nice solution.

-- 
Guillaume


pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: SSL over Unix-domain sockets
Next
From: Peter Eisentraut
Date:
Subject: Re: New trigger option of pg_standby