Re: select for update not locking properly.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Joseph Shraibman <jks(at)selectacast(dot)net>
Cc: "pgsql-general(at)hub(dot)org" <pgsql-general(at)hub(dot)org>
Subject: Re: select for update not locking properly.
Date: 2000-07-13 18:35:35
Message-ID: 1240.963513335@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-interfaces

Joseph Shraibman <jks(at)selectacast(dot)net> writes:
> OK here is the test program.

I don't know Java hardly at all, but it looks like you've got ten
threads in Java all issuing commands through a *single* connection
to a single backend. Postgres isn't going to lock those threads
against each other for you ... it has no idea whatever that the
sequence of commands it's seeing aren't all from one thread.

You'd need to have ten separate connections to ten separate backends
to get the behavior you're expecting. Try putting the Connection
objects into the Adder objects and firing them up at Adder creation.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2000-07-13 18:39:16 Re: performance question
Previous Message Tom Lane 2000-07-13 18:14:15 Re: postmaster crashing the server in 7.0.2

Browse pgsql-interfaces by date

  From Date Subject
Next Message Joseph Shraibman 2000-07-13 18:43:20 Re: select for update not locking properly.
Previous Message Joseph Shraibman 2000-07-13 18:12:59 Re: select for update not locking properly.