SQL Server Error 1222: Lock Request Timeout — Who Holds the Lock?
Distinction between Error 1222, 1205 deadlock, and client timeouts, identifying the head blocker session, and RCSI implementation.
The error string is a symptom, not the root cause. Do not restart the server blindly. Run the diagnostic queries below to pinpoint the actual failure mode.
▸Symptoms
Error 1222: Lock request time out period exceeded.▸Triage Sequence
- 1Find Head Blocker:
SELECT r.session_id, r.blocking_session_id, r.wait_time/1000 AS wait_sec, t.text
FROM sys.dm_exec_requests r
OUTER APPLY sys.dm_exec_sql_text(r.sql_handle) t
WHERE r.blocking_session_id <> 0;- 1Inspect Sleeping Transactions:
A session with status = 'sleeping' and open_transaction_count > 0 indicates an uncommitted transaction leak.
- 1Enable Read Committed Snapshot Isolation (RCSI):
ALTER DATABASE app_db SET READ_COMMITTED_SNAPSHOT ON;Eliminates reader/writer blocking without the dirty reads caused by WITH (NOLOCK).
Other Database Error Triage Playbooks
Other battle-tested diagnostic guides for high-severity database errors.
SQL Server Error 18456: Root Cause by State Code Matrix
In Error 18456, the State code reveals the actual root cause. Specific fixes for State 5, 8, 11, 18, 38, and 40, with ERRORLOG extraction scripts.
SQL Server Error 1205 Deadlock: Graph Extraction and Prevention
Extracting the deadlock graph from the system_health Extended Events ring buffer, understanding victim election, and architectural resolution.
SQL Server Pool Timeout: Connection Pool Exhaustion Fix
Difference between connection pool timeout and query command timeout, detecting connection leaks, and .NET DbContext architectural fixes.