MetricSign
EN|NLRequest Access
High severityexecution

Power BI Refresh Error:
SQL execution aborted: lock wait timeout

What does this error mean?

A DML statement (UPDATE, DELETE, or MERGE) was aborted because it could not acquire a lock on the target table within the allowed wait time. Another concurrent DML statement held an incompatible lock on the same table.

Common causes

  • 1Two concurrent MERGE or UPDATE statements targeting the same table ran simultaneously
  • 2A long-running transaction held a table lock and a second statement exceeded the lock wait timeout
  • 3A failed or orphaned transaction was not rolled back, leaving a dangling lock on the table
  • 4Multiple dbt models running in parallel all targeted the same incremental table
  • 5A bulk load COPY INTO and a concurrent DML operation competed for the same table lock

How to fix it

  1. 1Run SHOW TRANSACTIONS to identify the blocking transaction and SYSTEM$ABORT_TRANSACTION to terminate it if orphaned.
  2. 2Increase LOCK_TIMEOUT_IN_SECONDS for the session to allow the statement to wait longer: ALTER SESSION SET LOCK_TIMEOUT_IN_SECONDS = 300.
  3. 3Serialize concurrent DML on the same table by using Snowflake tasks with explicit ordering or dbt thread limits.
  4. 4Break large MERGE operations into smaller batches keyed on a partition column to reduce lock contention.
  5. 5Ensure all transactions are explicitly committed or rolled back — open transactions accumulate locks indefinitely.

Frequently asked questions

Does Snowflake use row-level or table-level locking for DML?

Snowflake uses table-level micro-partition locking for DML operations. Multiple INSERTS can run concurrently, but UPDATE, DELETE, and MERGE require exclusive access to the modified partitions, which can serialize writes on busy tables.

Will COPY INTO conflict with a concurrent UPDATE?

Yes. COPY INTO and UPDATE/MERGE on the same table compete for the same partition-level locks. Schedule bulk loads and incremental updates at different times, or use separate staging tables and a merge step.

Other execution errors