Non-Blocking Locks (i.e. Oracle NOWAIT) - Mailing list pgsql-sql

From Jan Bernhardt
Subject Non-Blocking Locks (i.e. Oracle NOWAIT)
Date
Msg-id 20030715144438.27550a7e.jb@baltic-online.de
Whole thread Raw
Responses Re: Non-Blocking Locks (i.e. Oracle NOWAIT)  (Dmitry Tkach <dmitry@openratings.com>)
Re: Non-Blocking Locks (i.e. Oracle NOWAIT)  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
Hi there,

though this question has been asked several times before (but never really
answered), I have to give it another try.

I have a multi-user application which synchronizes access to certain datasets
via the database itself. If a user has a project in that application open no
other user should be able to work on it too. When developing the application I
considered the database to be a place to handle the synchronization since
transactions are (normally) an integral part of a database system. When a user
opens a project the application firstly locks a corresponding row. But since I
don't want the application to block if that row is already locked I use the
Oracle "NOWAIT" feature (SELECT ... FOR UPDATE NOWAIT) which tries to receive
the lock on the specified row and if that row is already locked it returns
with an error without blocking and I can tell the user that the project is
already in use.

Now that the application is to be ported to PG I need a similar functionality.
Is there that an animal? If not, what would you recommend?

TIA,

- Jan.


pgsql-sql by date:

Previous
From: Erik Thiele
Date:
Subject: Re: summing tables
Next
From: Scott Cain
Date:
Subject: Cannot insert dup id in pk