Re: [araman@india-today.com: locking problem with JDBC (suspicion)] - Mailing list pgsql-general

From Tom Lane
Subject Re: [araman@india-today.com: locking problem with JDBC (suspicion)]
Date
Msg-id 4522.982076877@sss.pgh.pa.us
Whole thread Raw
In response to Re: [araman@india-today.com: locking problem with JDBC (suspicion)]  ("Richard Huxton" <dev@archonet.com>)
Responses Re: [araman@india-today.com: locking problem with JDBC (suspicion)]  (Anand Raman <araman@india-today.com>)
List pgsql-general
"Richard Huxton" <dev@archonet.com> writes:
> Well, foreign keys enforce constraints so it's not unreasonable that the
> lock might extend to the referenced tables.

Precisely.  The SELECT FOR UPDATE is done to ensure that the referenced
rows don't go away before the update of the referencing table commits.

I'm guessing that Anand's not shown us all the operations involved,
and that when things hang up it's because there are two different
transactions trying to lock overlapping sets of referenced rows.
Hard to tell from the info we have, however.

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: "downgrade" 7.1.x to 7.0.x
Next
From: Bruce Momjian
Date:
Subject: Re: Re: numeric type and odbc from access 2000