Re: select for update not locking properly. - Mailing list pgsql-general

From Tom Lane
Subject Re: select for update not locking properly.
Date
Msg-id 1240.963513335@sss.pgh.pa.us
Whole thread Raw
In response to Re: select for update not locking properly.  (Joseph Shraibman <jks@selectacast.net>)
List pgsql-general
Joseph Shraibman <jks@selectacast.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

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: postmaster crashing the server in 7.0.2
Next
From: "Peter Mount"
Date:
Subject: Re: Using the JDBC Driver in version 7.02