Received: from p1.selectacast.net (IDENT:root@p1.selectacast.net [206.41.1.251]) by hub.org (8.10.1/8.10.1) with ESMTP id e6DIhP088563 for ; Thu, 13 Jul 2000 14:43:25 -0400 (EDT) Received: from selectacast.net (IDENT:jks@d1 [209.219.91.66]) by p1.selectacast.net (8.9.3/8.9.3) with ESMTP id OAA31051; Thu, 13 Jul 2000 14:43:21 -0400 Message-ID: <396E0DC8.D8CDF135@selectacast.net> Date: Thu, 13 Jul 2000 14:43:20 -0400 From: Joseph Shraibman Organization: Xtenit X-Mailer: Mozilla 4.72 [en] (X11; U; Linux 2.2.15 i686) X-Accept-Language: en MIME-Version: 1.0 To: Tom Lane CC: "pgsql-general@hub.org" , "pgsql-interfaces@postgreSQL.org" Subject: Re: select for update not locking properly. References: <396D2AEA.5D19984A@selectacast.net> <28676.963473660@sss.pgh.pa.us> <396E06AB.7544C109@selectacast.net> <1240.963513335@sss.pgh.pa.us> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200007/585 Damn, I though having seperate Statement objects was supposed to take care of that. Peter can you confirm this? Tom Lane wrote: > > Joseph Shraibman 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