Skip site navigation (1) Skip section navigation (2)

Re: select for update not locking properly.

From: Joseph Shraibman <jks(at)selectacast(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "pgsql-general(at)hub(dot)org" <pgsql-general(at)hub(dot)org>, "pgsql-interfaces(at)postgreSQL(dot)org" <pgsql-interfaces(at)postgreSQL(dot)org>
Subject: Re: select for update not locking properly.
Date: 2000-07-13 18:43:20
Message-ID: 396E0DC8.D8CDF135@selectacast.net (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-interfaces
Damn, I though having seperate Statement objects was supposed to take
care of that.

Peter can you confirm this?

Tom Lane wrote:
> 
> 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

pgsql-interfaces by date

Next:From: Joseph ShraibmanDate: 2000-07-13 21:29:23
Subject: How do I use connection pooling?
Previous:From: Tom LaneDate: 2000-07-13 18:35:35
Subject: Re: select for update not locking properly.

pgsql-general by date

Next:From: ernie clineDate: 2000-07-13 18:53:33
Subject: Re: performance question
Previous:From: Tom LaneDate: 2000-07-13 18:39:16
Subject: Re: performance question

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group