but all the 5 time it is achieving the lock
When @LockOwner is set as "Transaction", the lock is released either with a call to sp_releaseapplock or when the transaction is committed or rolled back.
For more details , please refer to this article: Prevent multiple users from running the same SQL Server stored procedure at the same time
Best regards,
LiHong
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our Documentation to enable e-mail notifications if you want to receive the related email notification for this thread.