Runaway Locks

Runaway Locks

am 30.04.2010 15:03:06 von Kamcheung Sham

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

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
--=20
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

Re: Runaway Locks

am 04.05.2010 18:09:22 von Bob Lunney

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 wrote:

> From: Kamcheung Sham
> Subject: [ADMIN] Runaway Locks
> To: pgsql-admin@postgresql.org
> Date: Friday, April 30, 2010, 9:03 AM
>=20
> 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:
>=20
> 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  
> locktype |=A0 =A0   =A0mode=A0 =A0
>   =A0|=A0 =A0 =A0 =A0 =A0
> relname=A0 =A0 =A0 =A0   =A0|
> virtualtransaction | pid 
> ----------+------------------+----------------------------+- -------------=
------+------
>=20
> relation | AccessShareLock=A0 | pg_locks=A0 =A0
> =A0 =A0 =A0 =A0 =A0 =A0
>   =A0| 1/38=A0 =A0 =A0 =A0 =A0
> =A0   =A0| 1816=20
> relation | RowShareLock=A0   =A0|
> hibernate_sequences=A0 =A0 =A0 =A0 |
> -1/2091555=A0 =A0 =A0   =A0|=A0
> =A0  
> relation | RowExclusiveLock | hibernate_sequences=A0
> =A0 =A0 =A0 | -1/2091555=A0 =A0 =A0
>   =A0|=A0 =A0  
> relation | AccessShareLock=A0 | pg_class_oid_index=A0
> =A0 =A0   =A0| 1/38=A0 =A0 =A0
> =A0 =A0 =A0   =A0| 1816=20
> relation | AccessShareLock=A0 |
> pg_class_relname_nsp_index | 1/38=A0 =A0 =A0 =A0
> =A0 =A0   =A0| 1816=20
> relation | AccessShareLock=A0 | pg_class=A0 =A0
> =A0 =A0 =A0 =A0 =A0 =A0
>   =A0| 1/38=A0 =A0 =A0 =A0 =A0
> =A0   =A0| 1816
> (6 rows)arc_dev=3D#=20
>=20
> 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).
>=20
> My question is how do i kill the virtual transaction and
> have the locks released?
>=20
> Thanks,
> kam
> --=20
> Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin
>=20




--=20
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin