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 BEDEDDBAB3 for ; Fri, 18 Nov 2005 14:03:58 -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 66421-04 for ; Fri, 18 Nov 2005 18:03:57 +0000 (GMT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from smtp105.rog.mail.re2.yahoo.com (smtp105.rog.mail.re2.yahoo.com [206.190.36.83]) by svr1.postgresql.org (Postfix) with SMTP id EA2D2DBAB1 for ; Fri, 18 Nov 2005 14:03:55 -0400 (AST) Received: (qmail 455 invoked from network); 18 Nov 2005 18:03:48 -0000 Received: from unknown (HELO phlogiston.dydns.org) (a.sullivan@rogers.com@209.222.54.227 with login) by smtp105.rog.mail.re2.yahoo.com with SMTP; 18 Nov 2005 18:03:48 -0000 Received: by phlogiston.dydns.org (Postfix, from userid 1000) id 3847A40B5; Fri, 18 Nov 2005 13:03:47 -0500 (EST) Date: Fri, 18 Nov 2005 13:03:47 -0500 From: Andrew Sullivan To: pgsql-jdbc@postgresql.org Subject: Re: Deadlock problem Message-ID: <20051118180347.GA29354@phlogiston.dyndns.org> References: <200511181209.000000EC@dev-null> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200511181209.000000EC@dev-null> User-Agent: Mutt/1.5.9i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[AWL=0.000] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200511/115 X-Sequence-Number: 14213 On Fri, Nov 18, 2005 at 12:09:16PM +0200, Vit Timchishin wrote: > I suppose that this means that I've first used connection object > from one thread and this thread pid (linux x86-64) took exclusive > lock and now another thread tries to use same connection and is > going into lock. Am I correct? If so, why this exclusive locks are > help while there no other queries executed? Or does this mean I > can't use same connection object from different threads? The answer to question (1) is "presumably", and the answer to question (2) is "there is too another query being executed". There _must_ be a query being executed by the back end (whatever your application thinks), because that's what's got the exlusive lock. Moreover, an exclusive lock is pretty strong -- presumably a row is being modified. But I suspect that, whatever you're doing, you don't really want to be using the same connection object from different threads (unless you mean, serially -- like a connection pool which hands out "the same connection" multiple times). If this connection is being actively used by more than one thread concurrently, things are going to break in really surprising ways. A -- Andrew Sullivan | ajs@crankycanuck.ca "The year's penultimate month" is not in truth a good way of saying November. --H.W. Fowler