Lock wait timeouts

Even if a transaction is not involved in a deadlock, it might have to wait a considerable amount of time to obtain a lock because of a long-running transaction or transactions holding locks on the tables it needs. In such a situation, you might not want a transaction to wait indefinitely. Instead, you might want the waiting transaction to abort, or time out, after a reasonable amount of time, called a lock wait timeout. (For information about configuring the lock wait timeout, see Configuring deadlock detection and lock wait timeouts.)

Related concepts
Avoiding Deadlocks
Deadlock detection
Configuring deadlock detection and lock wait timeouts
Debugging Deadlocks
Programming applications to handle deadlocks