automatic expiry of locks | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

automatic expiry of locks

Hi, My company is developing a web app with SQL Server on the backend. Our team does not have a lot of experience with SQL Server, and I have a pretty basic question. We are implementing transactions, and are trying to figure out if locks held by orphaned transactions can be released without manual intervention. Is there a way to set a limit to the life of a lock? We want a lock to be released once the time limit is exceeded. Any help is greatly appreciated. thanks, chalakanth These 2 links will help you to understand about Locks and reduce them. Satya SKJ
This posting is provided “AS IS” with no rights for the sake of knowledge sharing.
You can use it to solve ur purpose. –sets the lock time-out period to 1,800 milliseconds.
GO Thanks,
Thanks for the replies. I’ll look into the articles. I am not sure that LOCK_TIMEOUT will help. The documentation says that LOCK_TIMEOUT stops a process from waiting to acquire a lock indefinitely. Our problem is that a process already has a lock and holds it indefinitely. We want that process to release the lock after a certain time. thanks again.