posted 14 years ago
It depends on the system in question, but generally speaking there are two way to go: an optimistic locking strategy or a pessimistic locking strategy.
You'll need to determine if collisions are expected to occur frequently in your multi-user system and what's an acceptable way of dealing with them when they do. The first strategy seems like the most obvious candidate for a foolproof solution, but a pessimistic approach risks compromising the performance of the system as a whole, which is something to be wary of.
Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.