UPDATE (2010-12-21): Completely rewrote this question based on tests that I\'ve been doing. Also, this used to be a POCO specific question, but it turns out that my
Here is another approach that is a bit more generic and fits in the data layer:
// if any timestamps have changed, throw concurrency exception
var changed = this.ChangeTracker.Entries<>()
.Any(x => !x.CurrentValues.GetValue("Timestamp").SequenceEqual(
x.OriginalValues.GetValue("Timestamp")));
if (changed) throw new OptimisticConcurrencyException();
this.SaveChanges();
It just checks to see if the TimeStamp has changed and throws concurrency exception.