Thread: Mutex via database
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: +4936207 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/ ---------------------------------------------------------------------
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