X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 31D0ADAFA8 for ; Tue, 22 Nov 2005 07:53:54 -0400 (AST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 95443-05 for ; Tue, 22 Nov 2005 11:53:56 +0000 (GMT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail.gtech.kiev.ua (mail.gtech.kiev.ua [213.186.209.2]) by svr1.postgresql.org (Postfix) with ESMTP id EB7D5DA9A8 for ; Tue, 22 Nov 2005 07:53:50 -0400 (AST) Received: from localhost ([127.0.0.1]) by mail.gtech.kiev.ua for pgsql-jdbc@postgresql.org; Tue, 22 Nov 2005 12:56:04 +0200 Received: from dev-null (localhost [127.0.0.1]) by dev-null (Weasel v1.10); 22 Nov 2005 13:53:45 +0200 From: "Vit Timchishin" To: "Kris Jurka" Cc: "pgsql-jdbc@postgresql.org" Date: Tue, 22 Nov 2005 13:53:44 +0200 (EET) Reply-To: "Vit Timchishin" X-Mailer: PMMail 2.10.2010 for OS/2 Warp 4.05 In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: 8bit Subject: Re: Deadlock problem Message-ID: <200511221353.000000EK@dev-null> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[none] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200511/146 X-Sequence-Number: 14244 On Mon, 21 Nov 2005 18:06:37 -0500 (EST), Kris Jurka wrote: > > >On Mon, 21 Nov 2005, Vit Timchishin wrote: > >> I am not using one connection and at the time of block there is only one >> active query (that is locked) at the whole database (in my test case). >> But for one transaction it may be used by different java threads (e.g. >> main thread and finalizer) and it seems that this is producing problems >> because exclusive lock is held after statement have finished. It is >> possible that I am still having open resultsets (did not check), but >> they are all forward only and not updateable. >> > >Locks are always held until transaction commit, not the end of an >individual statement. So, while you may only have one statement executing >you have more than one transaction in progress and this is causing your >deadlocks. This is not the problem. I know good about locks, but this one: relation | database | transaction | pid | mode | granted ----------+----------+-------------+-------+-----------------+--------- | | 1109601 | 32172 | ExclusiveLock | t 1) Not related to any relation. Relation and database fields are null 2) Intertransaction - transaction field of lock that is granted (example above) and that is trying to lock are equal. The only difference is the pid column (and that the lock that is trying is SharedLock and granted = f). С уважением, Виталий Валериевич Тимчишин, Технический Директор ООО "Голден Технолоджис" http://www.gtech-ua.com