Re: Clearing locks - Mailing list pgsql-general

From Andrew Sullivan
Subject Re: Clearing locks
Date
Msg-id 20050322141953.GA23524@phlogiston.dyndns.org
Whole thread Raw
In response to Re: Clearing locks  (Neil Conway <neilc@samurai.com>)
List pgsql-general
On Tue, Mar 22, 2005 at 04:19:06PM +1100, Neil Conway wrote:
> Edwin New wrote:
> >I have encountered a situation where a java process is dying but leaving
> >locks active.
>
> So it seems that the problem is that when the client dies, it is not
> actually disconnecting from PostgreSQL, and is in the midst of a
> transaction that has acquired some locks. Perhaps this is due to buggy
> connection pooling software that does not rollback a connection's

It needn't even be a matter of a pool.  I've seen plenty of cases
where the transaction is in mid-execution when the client dies.  The
connection stays open because the transaction is still going on
(think of a very long running UPDATE, for instance).  The transaction
will indeed roll back when the back end attempts to deliver the
results, and finds the client is gone.  But in the mean time, the
locks are maintained.

In any case, the answer probably is still to kill -2 the offending
back end.

A

--
Andrew Sullivan  | ajs@crankycanuck.ca
The fact that technology doesn't work is no bar to success in the marketplace.
        --Philip Greenspun

pgsql-general by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: Constraint problem
Next
From: Peter Eisentraut
Date:
Subject: Re: multi line text data/query ?bug?