[erlang-questions] Looking for advice on simultaneous data modification
Wed Jun 17 15:53:49 CEST 2015
Hello dear list. I am looking for advice to, perhaps, very common problem.
I have database which does not support transactions, only CAS operations
for single record.
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
So my intention is to do some kind of a mutex, which incorporate following
* when main record is in deletion-state, every other action on main and/or
dependent record should wait until it will be deleted;
* if main record is in normal-state, all dependencies may be modified
without any strict order.
Is there any library in the wild which allow me to do this kind of mutex?
Maybe I have chosen wrong approach? Any suggestions?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions