Differential Locking

OK, so here’s what I consider to be an improvement over Optimistic Locking. You know, the one, where you have a version field that is used to verify that the changes are based on the latest. Imagine a non-trivial object with tens of fields and a likelihood of these being edited concurrently — it’s clear that the traditional approach breaks down and that we need a different solution.

I came up with just one like that and call it Differential Locking. And here’s how it goes.