Hello,
we have a long running procedure that should not run parallel. If it runs in a transaction we get problems with the transaction log, so we decided to use an application lock
sp_getapplock
At the end of the procedure the lock is released, also if errors occure that we can catch.
sp_releaseapplock
The Problem: when somebody aborts the procedure, that application lock will stay alive. How can we handle this best? Maybe there is a way to determine and displace "zombie locks" at the begin of the procedure?
Thanks!
Tobias