As we were discussing concurrency options in my previous articles here , we noted that updating the database with SubmitChanges could update a single record or any number of records (even across multiple tables). If we run into conflicts, we can decide how to handle the conflict. However, we didn’t point out previously that if [...]
Archive for the ‘LINQ’ Category
Resolving the concurrency conflicts in LINQ using Transactions
Posted in .NET Framework, LINQ on April 23, 2009 | 1 Comment »
Handling Concurrency in LINQ to SQL -Part 3
Posted in .NET Framework, LINQ on April 23, 2009 | Leave a Comment »
In my earlier articles I showed how we can handle the concurrency using UpdateCheck. In this articles I will show how to deal with Concurrency Exceptions.
In using the Always or WhenChanged options for UpdateCheck, it is inevitable that two users will modify the same values and cause conflicts. In those cases, the DataContext will raise a [...]
Handling Concurrency in LINQ to SQL -Part 2
Posted in LINQ on April 21, 2009 | Leave a Comment »
In my earlier article here I showed you how to reproduce the concurreny issues in LINQ to SQL. In this article and in the subsequent articles I will write more about how to resolve the conflicts arising out of these concurrency.
USING UpdateCheck :
When SubmitChanges is called on the DataContext, the Update statement is generated and [...]
Handling Concurrency in LINQ to SQL-Part 1
Posted in .NET Framework, LINQ on March 19, 2009 | Leave a Comment »
In a typical production system which is used by multiple users at the same time, we need to take into account the conflicts that arise when two users try to change the same record at the same time. These are generally handled by two types of strategies.
1. Pessimistic Concurrency
2. Optimistic concurrency.
By default LINQ will [...]