Runaway Locks

I was connecting to Postgres 8.3 through JDBC. During my unit tests, someth=
ing when wrong and now leaving with the following locks in the db:

arc_dev=3D# select locktype, mode, relname, virtualtransaction, pid from pg=
_locks l join pg_class c on l.relation =3D c.oid; =
=

locktype | mode | relname | virtualtransacti=
on | pid
----------+------------------+----------------------------+- ---------------=
----+------
relation | AccessShareLock | pg_locks | 1/38 =
| 1816
relation | RowShareLock | hibernate_sequences | -1/2091555 =
|
relation | RowExclusiveLock | hibernate_sequences | -1/2091555 =
|
relation | AccessShareLock | pg_class_oid_index | 1/38 =
| 1816
relation | AccessShareLock | pg_class_relname_nsp_index | 1/38 =
| 1816
relation | AccessShareLock | pg_class | 1/38 =
| 1816
(6 rows)arc_dev=3D#

The locks on 'hibernate_sequences' is causing any update to the locked row =
to hang. There is currently no running database client process anymore (as =
I've restarted by server a few times).

My question is how do i kill the virtual transaction and have the locks rel=
eased?

Thanks,
kam
--
Sent via pgsql-admin mailing list (pgsql-admin [at] postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
Kamcheung Sham [ Fr, 30 April 2010 15:03 ] [ ID #2040750 ]

Re: Runaway Locks

If you're using Tomcat or some other Java container that does connection ma=
nagement restart it and the lock should go away.

Bob Lunney

--- On Fri, 4/30/10, Kamcheung Sham <csham [at] computer.org> wrote:

> From: Kamcheung Sham <csham [at] computer.org>
> Subject: [ADMIN] Runaway Locks
> To: pgsql-admin [at] postgresql.org
> Date: Friday, April 30, 2010, 9:03 AM
>
> I was connecting to Postgres 8.3 through JDBC. During my
> unit tests, something when wrong and now leaving with the
> following locks in the db:
>
> arc_dev=3D# select locktype, mode, relname,
> virtualtransaction, pid from pg_locks l join pg_class c on
> l.relation =3D c.oid;=A0 =A0 =A0 =A0 =A0 =A0
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0
> locktype |=A0 =A0 =A0=A0=A0mode=A0 =A0
> =A0=A0=A0|=A0 =A0 =A0 =A0 =A0
> relname=A0 =A0 =A0 =A0 =A0=A0=A0|
> virtualtransaction | pid=A0
> ----------+------------------+----------------------------+- -------------=
------+------
>
> relation | AccessShareLock=A0 | pg_locks=A0 =A0
> =A0 =A0 =A0 =A0 =A0 =A0
> =A0=A0=A0| 1/38=A0 =A0 =A0 =A0 =A0
> =A0 =A0=A0=A0| 1816
> relation | RowShareLock=A0 =A0=A0=A0|
> hibernate_sequences=A0 =A0 =A0 =A0 |
> -1/2091555=A0 =A0 =A0 =A0=A0=A0|=A0
> =A0 =A0
> relation | RowExclusiveLock | hibernate_sequences=A0
> =A0 =A0 =A0 | -1/2091555=A0 =A0 =A0
> =A0=A0=A0|=A0 =A0 =A0
> relation | AccessShareLock=A0 | pg_class_oid_index=A0
> =A0 =A0 =A0=A0=A0| 1/38=A0 =A0 =A0
> =A0 =A0 =A0 =A0=A0=A0| 1816
> relation | AccessShareLock=A0 |
> pg_class_relname_nsp_index | 1/38=A0 =A0 =A0 =A0
> =A0 =A0 =A0=A0=A0| 1816
> relation | AccessShareLock=A0 | pg_class=A0 =A0
> =A0 =A0 =A0 =A0 =A0 =A0
> =A0=A0=A0| 1/38=A0 =A0 =A0 =A0 =A0
> =A0 =A0=A0=A0| 1816
> (6 rows)arc_dev=3D#
>
> The locks on 'hibernate_sequences' is causing any update to
> the locked row to hang. There is currently no running
> database client process anymore (as I've restarted by server
> a few times).
>
> My question is how do i kill the virtual transaction and
> have the locks released?
>
> Thanks,
> kam
> --
> Sent via pgsql-admin mailing list (pgsql-admin [at] postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin
>




--
Sent via pgsql-admin mailing list (pgsql-admin [at] postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
Bob Lunney [ Di, 04 Mai 2010 18:09 ] [ ID #2040816 ]
Datenbanken » gmane.comp.db.postgresql.admin » Runaway Locks

Vorheriges Thema: Statistics collector port / unix dom. socket?
Nächstes Thema: Autovacuum stopped running