<div dir="ltr">Have a look at <a href="http://www.erlang.org/doc/man/global.html#trans-2">http://www.erlang.org/doc/man/global.html#trans-2</a> , maybe that fits your bill?<div><br></div><div>/Robby</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 17 June 2015 at 14:53, Daniil Churikov <span dir="ltr"><<a href="mailto:ddosia@gmail.com" target="_blank">ddosia@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hello dear list. I am looking for advice to, perhaps, very common problem.<br><br>I have database which does not support transactions, only CAS operations for single record.<br>I have one-to-many relationship between 2 tables, and I need to implement cascade deletion of dependent records from table_2 when main record from table_1 was deleted. All the operations may happen in different processes simultaneously.<br>So my intention is to do some kind of a mutex, which incorporate following properties:<br>* when main record is in deletion-state, every other action on main and/or dependent record should wait until it will be deleted;<br>* if main record is in normal-state, all dependencies may be modified without any strict order.<br><br>Is there any library in the wild which allow me to do this kind of mutex?<br>Maybe I have chosen wrong approach? Any suggestions?<br><br></div>Thanks!<br></div>
<br>_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br></blockquote></div><br></div>