July 2015
Intermediate to advanced
1300 pages
87h 27m
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 24.1.
TABLE 24.1 RefreshMode Enumeration Members
The following is an example of handling optimistic concurrency, providing a revisited version of the previously utilized SaveChanges custom method:
Read now
Unlock full access