pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jan Bernhardt <jb@baltic-online.de>
Cc: pgsql-sql@postgresql.org
Subject: Re: Non-Blocking Locks (i.e. Oracle NOWAIT)
Date: Tue, 15 Jul 2003 11:17:35 -0400
Message-ID: <22695.1058282255@sss.pgh.pa.us> (raw)
In-Reply-To: <20030715144438.27550a7e.jb@baltic-online.de>
References: <20030715144438.27550a7e.jb@baltic-online.de>

Jan Bernhardt <jb@baltic-online.de> writes:
> 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.

You might be able to use the contrib/userlock module for this.

			regards, tom lane



view thread (5+ messages)  latest in thread

Message-ID: <22695.1058282255@sss.pgh.pa.us>
Permalink:  ../22695.1058282255@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/22695.1058282255@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, jb@baltic-online.de
  Subject: Re: Non-Blocking Locks (i.e. Oracle NOWAIT)
  In-Reply-To: <22695.1058282255@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox