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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Richard Huxton" <dev(at)archonet(dot)com>
Cc: "Anand Raman" <araman(at)india-today(dot)com>, "postgresql" <pgsql-general(at)postgresql(dot)org>
Subject: Re: [araman@india-today.com: locking problem with JDBC (suspicion)]
Date: 2001-02-13 15:07:57
Message-ID: 4522.982076877@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Richard Huxton" <dev(at)archonet(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2001-02-13 15:20:53 Re: strange query results
Previous Message Tom Lane 2001-02-13 15:00:31 Re: "downgrade" 7.1.x to 7.0.x