The current situation: We develop a program to manage multiple e-Commerce Shops. Editing an order is a task that includes many tables and therefore it's neccessary to use transactions. If the last query fails, all the previous changes must be reverted.
We have a function to alter orders into invoices. This function may alter multiple orders at once. Each alter has it's own transaction and they are processed one-by-one.
Now the problem: If 2 users use this function at the same time - on different orders - they run into a Deadlock...
DBMS: SQL Server 2008 R2 Connection Components: UniDAC v4.5.9 - TUniConnection
One solution I tried is, setting the LockMode to lmPessimistic. This reduces the Deadlocks, but they still occur...
UPDATE:
The problem was solved by using "READ_COMMITTED_SNAPSHOT" as the database Isolation Mode. This works fine for us, but won't work for all Deadlock Situations and has some sideeffects!