Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredJoin us at FabCon Vienna from September 15-18, 2025, for the ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM. Get registered
Hi,
i have the following situation:
Load and update is located in one parametrized pipeline.
Now i want to run this pipeline in parallel foreach loop to save time, but on the update i get the following error:
"Snapshot isolation transaction aborted due to update conflict. Using snapshot isolation to access table 'cfgLoadctl_Bronze' directly or indirectly in database 'wh_riskdb_test' can cause update conflicts if rows in that table have been deleted or updated by another concurrent transaction. Retry the transaction."
Does anyone have any ideas on how to solve this problem?
Thanks!
Solved! Go to Solution.
This is because the Warehouse uses optimistic concurrency (snapshot isolation) when writing/reading from tables (based on what delta supports). You can get clashes when multiple update statements hit the same table in parallel. Inserts don't cause issues so you may have to modify your process to insert an initial status and then write another row with the new status and timestamp.
I go through transactions behaviour here https://www.serverlesssql.com/transaction-isolation-in-fabric-warehouses/
hope it helps
Hello
Thanks for using the Fabric community.
What pointed is the core of the problem and I am adding the adding which is relevant for other community members for readablity . Thanks
Updating Data
What about UPDATEing data? Put simply, if there are multiple open transactions on a single table at the same time, the transaction that commits first wins, the other transactions will rollback and return an error. Yup, it’s not the transaction that started first…which means if you have an UPDATE query that is long running and another UPDATE begins and commits before the long running query, then sorry but your long running UPDATE will fail.
From the MS Docs “Conflicts from two or more concurrent transactions that update one or more rows in a table are evaluated at the end of the transaction. The first transaction to commit completes successfully and the other transactions are rolled back with an error returned.“
Since the snapshot isolation is the only thing offered at this time , I suggest you can try to write the max timestamp into a csv file ( WITH APPEND ) and at the end of the process you can read this file and write into a SQL table .
Thanks
HImanshu
Hi Himanshu,
thanks for the (unfortunately very ugly) workaround. i will test this approach.
As I mentioned previously, INSERTs have very minimal chance of locking so I would just only insert into your status table
This is because the Warehouse uses optimistic concurrency (snapshot isolation) when writing/reading from tables (based on what delta supports). You can get clashes when multiple update statements hit the same table in parallel. Inserts don't cause issues so you may have to modify your process to insert an initial status and then write another row with the new status and timestamp.
I go through transactions behaviour here https://www.serverlesssql.com/transaction-isolation-in-fabric-warehouses/
hope it helps
Hi @cw88 if I have helped resolve your query would you mind marking my reply as the solution to close this thread off?
many thanks
User | Count |
---|---|
2 | |
1 | |
1 | |
1 | |
1 |
User | Count |
---|---|
5 | |
3 | |
3 | |
2 | |
2 |