Forum Discussion
Trasaction deadlocked on lock resources
Hi,
I created a Dataflow Gen2 in Microsoft Fabric that loads multiple tables into a warehouse. Every time I run the dataflow, I receive the following error message:
Couldn't refresh the entity because of an issue with the mashup document MashupException.Error: Microsoft SQL: Transaction (Process ID 206) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction. Details: Reason = DataSource.Error;ErrorCode = 10478;DataSourceKind = Warehouse;DataSourcePath = Warehouse;DataSourceKind.2 = SQL;DataSourcePath.2 = qenzxdde3pdenc5pgrl56uss44-3nktrgkfckbedi5tclkxsvoogi.datawarehouse.fabric.microsoft.com;WH_Bronce;Message = Transaction (Process ID 206) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.;ErrorCode = -2146232060;Number = 1205;Class = 13;State = 51;ConnectionId = 090e3c20-db6d-492b-b2a6-48814400d26f;Microsoft.Data.Mashup.Error.Context = User GatewayObjectId: 714e5a6b-cca0-4a5a-bb6b-7c891e9991ba". Código de error: 104100. (Id. de solicitud: 4926601a-0aa6-4cdf-86d4-e84f3cbd1767).
Any idea what it might be?
Thank you in advance.
7 Replies
- benibix
Resolver I
Hi jnlucas
Past 7 or 8 tables is the clue. With that many writes running at once, two of them are likely colliding in the warehouse, even when nothing else touches it. Learn says Warehouse locks at table level, and that CREATE, DROP, TRUNCATE and ALTER take a schema lock that blocks other work on that table. I can't see which statements Dataflow Gen2 sends when it writes, so I can't say which pair collides.
If you go back to Dataflow Gen2, split the tables into 2 or 3 dataflows and run them one after another from a pipeline, not side by side. Add a retry with a delay on the pipeline activity too, since Learn says to retry when concurrent transactions conflict.
https://learn.microsoft.com/en-us/fabric/data-warehouse/transactions
- jnlucasRegular Visitor
Hi v-saisrao-msft,
Yes I did, and the problem persists. As I mentioned, there is only one dataflow writing to the warehouse. The solution is currently being developed, and I am the only person working on it, so I can assure you that no one and no other process is writing in the warehouse.
In the end, I implemented the solution using a different approach, avoiding Dataflows Gen 2.
Thank you all for your help.
Regards,
- v-saisrao-msft
Community Support
HI jnlucas,
Since you have implemented an alternative approach, could you please confirm whether the issue is resolved with the new implementation?
Thank you.
- v-saisrao-msft
Community Support
HI jnlucas,
Have you had a chance to review the solution shared by Shubham_rai955 Murtaza_Ghafoor ? If the issue persists, feel free to reply so we can help further.
Thank you.
- Murtaza_Ghafoor
Super User
jnlucas
This error suggest a SQL deadlock in Fabric Warehouse, where multiple transactions compete for the same resources.Possible reasons:
- Multiple dataflows or pipelines running simultaneously.
- Concurrent writes to the same warehouse tables.
- Overlapping notebook or SQL operations.
Recommended approach:
- Check concurrent executions in Fabric Monitoring Hub.
- Avoid overlapping refreshes and concurrent writes to the same tables.
- Try sequential loading and rerun the failed refresh.
If the issue persists, investigate the specific destination table and loading operation.
If this helps, ✓ Mark as Kudos | Help Other
- jnlucasRegular Visitor
Hi Shubham,
Thank you for your quick reply.
I've already checked all that. The DataFlow Gen 2 is the only process writing to the Warehouse. However, it looks like the DataFlow is processing all its tables in parallel, which might causing the conflict.
The deadlock occurs every time I run the DataFlow so it's an not occasional issue.
I duplicated the DataFlow and ran it again with fewer tables, and in this case it worked, but as soon as I increased the number of tables beyond 7/8 tables the error started occuring again.
Any help will be welcome.
- Shubham_rai955
Super User
This error usually occurs when two or more transactions try to access or modify the same Warehouse resources at the same time, creating a deadlock.
I would check the following:
- Check concurrent operations: Make sure no other Dataflow, pipeline, or SQL query is writing to the same Warehouse tables while the Dataflow Gen2 is running.
- Avoid parallel writes: If multiple entities load into the same Warehouse simultaneously, try disabling parallel loading or splitting the refresh into sequential batches.
- Check destination tables: Look for overlapping loads, truncate-and-load operations, or other processes that modify the same tables.
- Retry the transaction: If the deadlock is occasional, configure a retry in the pipeline or orchestration process.
- Review query performance: Optimize transformations and SQL operations to reduce the time transactions hold locks.
- Test individual tables: Run the Dataflow with one table at a time to identify which entity causes the deadlock.
I would first check for concurrent writes to the Warehouse, then test the Dataflow entities individually. If the issue persists, capture the timing of the failed refreshes and check whether other workloads were running at the same time.