Mutex via database

Поиск
Список
Период
Сортировка
Искать

Mutex via database

От:
Enrico Weigelt <weigelt@metux.de>
Дата:

Hi folks,


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 ?


thx
-- 
---------------------------------------------------------------------Enrico Weigelt    ==   metux IT service phone:     +49 36207 519931         www:       http://www.metux.de/ fax:       +49 36207 519932         email:     contact@metux.de
--------------------------------------------------------------------- Realtime Forex/Stock Exchange trading powered by postgresSQL :))                                           http://www.fxignal.net/
---------------------------------------------------------------------

Re: Mutex via database

От:
Markus Schaber <schabi@logix-tt.com>
Дата:
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

FAQ