Environment: SQL, LINQ, C#
I have 2 WinForms running on different computers.
They all hit the same database, and it’s extremely critical that these forms don’t affect the state of the database. I have a couple of questions.
WinForm1, the linq queries in this form are all try/catched, if there is a concurrency conflict, I believe this will never fail (correct me if I’m wrong)
WinForm2, the linq queries in this form can conflict with the ones in WinForm1, but each query is also try/catched.
Question: If there are any concurrency conflicts between these forms, is it possible that the database will be locked out (no other queries can access the database)? If not, is there any situation where a concurrency conflict can make the database unqueriable?
LinqToSql uses Optimistic Concurrency, which does not lock the database.
Deadlocks are the actual threat, not concurrency conflicts.
The best approach to preventing deadlocks is to keep updates small and fast.