X-Original-To: pgsql-general-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id C09C39FA250 for ; Mon, 3 Jul 2006 15:11:06 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 36456-06 for ; Mon, 3 Jul 2006 15:10:58 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from net2.micro-automation.com (net2.micro-automation.com [64.7.141.29]) by postgresql.org (Postfix) with SMTP id 8C3819FA192 for ; Mon, 3 Jul 2006 15:10:58 -0300 (ADT) Received: (qmail 29490 invoked from network); 3 Jul 2006 18:10:55 -0000 Received: from unknown (HELO ?70.9.168.244?) (davec@70.9.168.244) by net2.micro-automation.com with SMTP; 3 Jul 2006 18:10:55 -0000 In-Reply-To: <1151923545.6055.40.camel@localhost> References: <1151923545.6055.40.camel@localhost> Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <1B97FB21-84A6-43FC-A2D4-85A51E14B80D@fastcrypt.com> Cc: pgsql-jdbc@postgresql.org, pgsql-general@postgresql.org Content-Transfer-Encoding: 7bit From: Dave Cramer Subject: Re: [JDBC] Is what I want possible and if so how? Date: Mon, 3 Jul 2006 14:08:50 -0400 To: Joost Kraaijeveld X-Mailer: Apple Mail (2.752.2) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200607/93 X-Sequence-Number: 97717 Joost, Everyone has to do a select for update, then they will be serialized. Dave On 3-Jul-06, at 6:45 AM, Joost Kraaijeveld wrote: > Hi, > > I have a table with events that must be handled by multiple > clients. It > does not matter which client handles an event, but no two clients may > handle the same event and an event may only handled once. A client > can > only determine the availability of an event by querying the database. > The access to the table should be queue-like with synchronization. > > My idea was that a client should do a "SELECT" on the table and > mark the > selected records as "being handled" to avoid double handling. > > I have read the manual about "LOCK", "SET TRANSACTION" and > "SELECT...FOR > UPDATE", but from what I understand, they cannot prevent a "SELECT" > from > another client, based on the "SELECT". > > Is there a way to make this possible? > > TIA > > > -- > Groeten, > > Joost Kraaijeveld > Askesis B.V. > Molukkenstraat 14 > 6524NB Nijmegen > tel: 024-3888063 / 06-51855277 > fax: 024-3608416 > web: www.askesis.nl > > ---------------------------(end of > broadcast)--------------------------- > TIP 2: Don't 'kill -9' the postmaster >