Collision Detection

NDO comes with a mechanism for detecting collisions. To use it, all you need is an additional column in the tables for which you want to establish collision detection. The column must be able to hold a Guid.

All you have to do is to set the property TimeStampColumn in your mapping information to a name of your choice. NDO creates a Guid column for you.

Along with every write operation NDO generates a new Guid and stores it in the Time Stamp Column. When reading an object, NDO reads the value of the column and uses it at the next save. NDO adds a where-clause to the update or delete command which makes sure that the Time Stamp Column remained the same in the mean time. If there occurred a concurrent change in the mean time, the value is no longer the same and the write operation fails, giving the developer the opportunity to react.