Received: from sss2.sss.pgh.pa.us (sss.pgh.pa.us [209.114.166.2]) by hub.org (8.10.1/8.10.1) with ESMTP id e6DIZh083520 for ; Thu, 13 Jul 2000 14:35:43 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss2.sss.pgh.pa.us (8.9.3/8.9.3) with ESMTP id OAA01243; Thu, 13 Jul 2000 14:35:35 -0400 (EDT) To: Joseph Shraibman cc: "pgsql-general@hub.org" Subject: Re: select for update not locking properly. In-reply-to: <396E06AB.7544C109@selectacast.net> References: <396D2AEA.5D19984A@selectacast.net> <28676.963473660@sss.pgh.pa.us> <396E06AB.7544C109@selectacast.net> Comments: In-reply-to Joseph Shraibman message dated "Thu, 13 Jul 2000 14:12:59 -0400" Date: Thu, 13 Jul 2000 14:35:35 -0400 Message-ID: <1240.963513335@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200007/580 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