Re: Clearing locks

From: Andrew Sullivan <ajs(at)crankycanuck(dot)ca>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Clearing locks
Date: 2005-03-22 14:19:53
Message-ID: 20050322141953.GA23524@phlogiston.dyndns.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)crankycanuck(dot)ca
The fact that technology doesn't work is no bar to success in the marketplace.
--Philip Greenspun

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Peter Eisentraut 2005-03-22 14:35:06 Re: multi line text data/query ?bug?
Previous Message Bruno Wolff III 2005-03-22 13:23:44 Re: grant problem