4 ms·
The simplest way to understand OCC is to basically take any of your models and add a version attribute and whenever you update an object you also do an UPDATE .
by djb_hackernews 12y ago
The simplest way to understand OCC is to basically take any of your models and add a version attribute and whenever you update an object you also do an UPDATE ... WHERE version={obj.version}.
This is useful when you don't want writes to overwrite previous writes. If the version check doesn't hold it fails letting your client know that your assumptions about the state of the data are wrong. You then have a few options, like either redoing your computation using the new state or not doing anything at all because the current state is good.