May 2010
Intermediate to advanced
1272 pages
61h 18m
English
Optimistic concurrency is a scenario in which multiple clients send changes to the database simultaneously. LINQ to SQL allows resolving optimistic concurrency with the DataContext.ChangeConflicts.ResolveAll method. Such method receives an argument that is an enumeration of type System.Data.Linq.RefreshMode and allows resolving the exception with one of the enumeration members summarized in Table 25.1.
Table 25.1 RefreshMode Enumeration Members

The following is an example of handling optimistic concurrency, providing a revisited version of the previously utilized SaveChanges custom method:
Notice first how a
Read now
Unlock full access