3 messages in org.postgresql.pgsql-jdbcIs what I want possible and if so how?
FromSent OnAttachments
Joost KraaijeveldJul 3, 2006 3:45 am 
Tom LaneJul 3, 2006 8:03 am 
Dave CramerJul 3, 2006 11:08 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Is what I want possible and if so how?Actions...
From:Joost Kraaijeveld (J.Kr@Askesis.nl)
Date:Jul 3, 2006 3:45:22 am
List:org.postgresql.pgsql-jdbc

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