Is there a way to set the SQL deadlock priority in Entity Framework without having to open each connection explicitly and issue a SQL command to set the deadlock priority on that specific connection before using it?
Using explicit connections everywhere and issuing a SQL deadlock priority command is the only way I've found so far, which is a bit of a pain.
I'm currently working with Entity Framework versions 5 & 6 in different applications.
The purpose is to set deadlock priority low in automated applications (which can recover / retry on their own) so they don't interfere with user applications while any deadlock issues are being resolved.
Note: this question is not about tracking down or preventing deadlocks in Entity Framework - that's another topic well handled elsewhere here.
You can set the deadlock by running an explicit SQL statement/command or by running a stored procedure. This can also work on transaction isolation level or query hints. See https://msdn.microsoft.com/en-us/library/dn456843%28v=vs.113%29.aspx?f=255&MSPPError=-2147217396
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With