metricsign
Start free
Medium severitytimeout

Power BI Refresh Error:
1222

What does this error mean?

A transaction waited longer than the configured lock timeout for a lock to be released.

Common causes

  • 1A long-running transaction is holding locks on the rows or tables the failing query needs
  • 2The application has SET LOCK_TIMEOUT set too low for the expected query duration
  • 3Blocking chain caused by an uncommitted transaction holding an exclusive lock

How to fix it

  1. 1Step 1: Find the blocking chain: SELECT blocking_session_id, session_id, wait_type, wait_time/1000 as wait_sec, DB_NAME(database_id) as db FROM sys.dm_exec_requests WHERE blocking_session_id > 0;
  2. 2Step 2: Kill the head blocker if safe: KILL <session_id>; — confirm the session is not running a critical transaction first.
  3. 3Step 3: Increase lock timeout for batch operations: SET LOCK_TIMEOUT 30000; (milliseconds) — or investigate and fix the root blocking query.

Frequently asked questions

What is the default lock timeout in SQL Server?

By default, SET LOCK_TIMEOUT is -1, meaning wait indefinitely. Applications that set a positive value (e.g. 5000 ms) will get error 1222 after that duration. Check with: SELECT @@LOCK_TIMEOUT;

How do I find the head blocker in a blocking chain?

Run: SELECT session_id, blocking_session_id, wait_type, DB_NAME(database_id) FROM sys.dm_exec_requests WHERE blocking_session_id > 0; — trace back to the session with blocking_session_id = 0 and session_id referenced by others.

Is error 1222 the same as a deadlock?

No — a deadlock (1205) is when two sessions block each other in a cycle and SQL Server breaks the deadlock. Error 1222 is a lock timeout where one session waited too long for another session to release a lock.

Official documentation: https://learn.microsoft.com/en-us/sql/relational-databases/errors-events/mssqlserver-1222-database-engine-error

Other timeout errors