pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Sullivan <ajs@crankycanuck.ca>
To: pgsql-jdbc@postgresql.org
Subject: Re: Deadlock problem
Date: Fri, 18 Nov 2005 13:03:47 -0500
Message-ID: <20051118180347.GA29354@phlogiston.dyndns.org> (raw)
In-Reply-To: <200511181209.000000EC@dev-null>
References: <200511181209.000000EC@dev-null>

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



view thread (9+ messages)  latest in thread

Message-ID: <20051118180347.GA29354@phlogiston.dyndns.org>
Permalink:  ../20051118180347.GA29354@phlogiston.dyndns.org/
Also on:    postgresql.org/message-id/20051118180347.GA29354@phlogiston.dyndns.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: ajs@crankycanuck.ca
  Subject: Re: Deadlock problem
  In-Reply-To: <20051118180347.GA29354@phlogiston.dyndns.org>
  References: <200511181209.000000EC@dev-null> <20051118180347.GA29354@phlogiston.dyndns.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox