Re: Mutex via database - Mailing list pgsql-sql

From Markus Schaber
Subject Re: Mutex via database
Date
Msg-id 4278B436.6050102@logix-tt.com
Whole thread Raw
In response to Mutex via database  (Enrico Weigelt <weigelt@metux.de>)
List 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


pgsql-sql by date:

Previous
From: Enrico Weigelt
Date:
Subject: Mutex via database
Next
From: "2000 Informatica"
Date:
Subject: all server processes terminated; reinitializing