Question

I am using two web projects and both using same Database of MS SQL server 2008 R2 and both projects interacting to database through Dapper ORM, I am getting some ( 7 to 8 / day ) deadlock exceptions. Is it dapper's issue or my fault? Can anybody suggest me solution? I can provide more info if you need.

Accepted Answer

It's most likely you. Dapper translates everything into normal ADO.Net command objects. It works off of the IDbConnection interface via extension methods. I can't think of a way that it could cause a deadlock by itself. Please provide a minimal, repeatable example of your issue in play.

I'm fairly sure that it's a concurrency issue in your code.

If this example can be run without Dapper (i.e. pure SQL), then we can rule Dapper out as a cause.




Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why