Transaction LockMode exclusive


#1

Hi,

we are getting some deadlocks by this line
SET XACT_ABORT ON;exec sp_getapplock @Resource=@resource, @LockMode=N’Exclusive’, @LockOwner=N’Transaction’, @LockTimeout=-1;

In gthub https://github.com/HangfireIO/Hangfire/commit/915939295776b1ca5c45f413d1019ac45666c78f

say that is fixed in version 1.7 but is not working.

Can you help me?


#2

After performing migration and applying recommended settings as written in the upgrade guide, there sp_getapplock will not be called in that query. Also, any deadlock graphs will be useful to understand what queries are being deadlocked. You can use SQL Profiler to obtain them, trace flag 1222 or use a special query on SQL Azure.