Re: Mutex via database

From: Markus Schaber <schabi(at)logix-tt(dot)com>
To: pgsql-sql <pgsql-sql(at)postgresql(dot)org>
Cc: weigelt(at)metux(dot)de
Subject: Re: Mutex via database
Date: 2005-05-04 11:38:30
Message-ID: 4278B436.6050102@logix-tt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi, Enrico,

Enrico Weigelt wrote:

> i've a dozen of servers processing jobs from a database.
> Some servers may only run exactly once, otherwise I'll get jobs
> done twice.
>
> Is there any way for implementing an kind of mutex within the
> database, which is automatically released if the holding
> process/connection dies ?

Use the "LOCK" sql command, possibly together with transaction isolation
set to serializable.

Markus

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message 2000 Informatica 2005-05-04 14:08:34 all server processes terminated; reinitializing
Previous Message Enrico Weigelt 2005-05-04 11:28:46 Mutex via database