LinqToSQL and UpdateChecks
By default, LinqToSQL uses pessimistic concurrency when saving the changes to the tables. what this means is that it will check all fields when doing any updates or deletes, this usually goes against what we normally do with normal sql where we just update based on the primary key.
Additionally, this increases the load on the db server as well, since all updates and delete statements needs to go thru this check.
What’s good about this is that it ensures the data is the same as what you had before the update so that it is sure that it is updating the correct data.
So now, what if you do not want this behavior or want to settle for optimistic concurrency? By default each column in all the tables will have the updatecheck property set to always.
You can change it to Never for L2S to not check this column when doing updates/delete.
Alternatively there is a “When changed” which will check only when the field is changed.
Exactly which mode you prefer depends on your business model. But bear in mind that UpdateCheck=Always will increase the load on the db server quite easily especially during high update/delete loads