I have a database that is shared among possible different Ruby on Rails processes. To keep consistency, I would like the record I operate on is up-to-date.
I am hoping to solve this problem: process A reads a record, process B reads the same record, process A update the record, (now the instance of record in process B is stale). Since there are multiple processes involved, I clearly can not use any mutexes, etc.
Is there any good way to do this?