<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Warehouse: Parallel update on status table fails in Data Warehouse</title>
    <link>https://community.fabric.microsoft.com/t5/Data-Warehouse/Warehouse-Parallel-update-on-status-table-fails/m-p/3518078#M563</link>
    <description>&lt;P&gt;As I mentioned previously, INSERTs have very minimal chance of locking so I would just only insert into your status table&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 06 Nov 2023 15:52:05 GMT</pubDate>
    <dc:creator>AndyDDC</dc:creator>
    <dc:date>2023-11-06T15:52:05Z</dc:date>
    <item>
      <title>Warehouse: Parallel update on status table fails</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Warehouse/Warehouse-Parallel-update-on-status-table-fails/m-p/3513880#M557</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;i have the following situation:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Load data from several csv/xls files in warehouse staging tables&lt;/LI&gt;&lt;LI&gt;Update a status table with the max timestamp of staging tables&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Load and update is located in one parametrized pipeline.&lt;/P&gt;&lt;P&gt;Now i want to run this pipeline in parallel foreach loop to save time, but on the update i get the following error:&amp;nbsp;&lt;/P&gt;&lt;P&gt;"&lt;EM&gt;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.&lt;/EM&gt;"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone have any ideas on how to solve this problem?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Nov 2023 07:28:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Warehouse/Warehouse-Parallel-update-on-status-table-fails/m-p/3513880#M557</guid>
      <dc:creator>cw88</dc:creator>
      <dc:date>2023-11-03T07:28:08Z</dc:date>
    </item>
    <item>
      <title>Re: Warehouse: Parallel update on status table fails</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Warehouse/Warehouse-Parallel-update-on-status-table-fails/m-p/3513920#M558</link>
      <description>&lt;P&gt;This is because the Warehouse uses optimistic concurrency (snapshot isolation) when writing/reading from tables (based on what delta supports). &amp;nbsp;You can get clashes when multiple update statements hit the same table in parallel. &amp;nbsp;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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I go through transactions behaviour here&amp;nbsp;&lt;A href="https://www.serverlesssql.com/transaction-isolation-in-fabric-warehouses/" target="_blank"&gt;https://www.serverlesssql.com/transaction-isolation-in-fabric-warehouses/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;hope it helps&lt;/P&gt;</description>
      <pubDate>Fri, 03 Nov 2023 07:50:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Warehouse/Warehouse-Parallel-update-on-status-table-fails/m-p/3513920#M558</guid>
      <dc:creator>AndyDDC</dc:creator>
      <dc:date>2023-11-03T07:50:24Z</dc:date>
    </item>
    <item>
      <title>Re: Warehouse: Parallel update on status table fails</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Warehouse/Warehouse-Parallel-update-on-status-table-fails/m-p/3515053#M559</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="577765" data-lia-user-login="cw88" class="lia-mention lia-mention-user"&gt;cw88&lt;/a&gt;&amp;nbsp;if I have helped resolve your query would you mind marking my reply as the solution to close this thread off?&lt;/P&gt;&lt;P&gt;many thanks&lt;/P&gt;</description>
      <pubDate>Fri, 03 Nov 2023 18:31:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Warehouse/Warehouse-Parallel-update-on-status-table-fails/m-p/3515053#M559</guid>
      <dc:creator>AndyDDC</dc:creator>
      <dc:date>2023-11-03T18:31:12Z</dc:date>
    </item>
    <item>
      <title>Re: Warehouse: Parallel update on status table fails</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Warehouse/Warehouse-Parallel-update-on-status-table-fails/m-p/3515074#M560</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&amp;nbsp;&lt;BR /&gt;Thanks for using the Fabric community.&lt;BR /&gt;What&amp;nbsp;&amp;nbsp;pointed&amp;nbsp; is the core of the problem and I am adding the adding which is relevant for other community members for readablity . Thanks&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;EM&gt;Updating Data&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;&lt;EM&gt;What about UPDATEing data? Put simply, if there are multiple open transactions on a single table at the same time, the transaction that&amp;nbsp;&lt;STRONG&gt;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.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;&lt;EM&gt;From the MS Docs&amp;nbsp;“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.“&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since the snapshot isolation is the only thing offered at this time&amp;nbsp; , I&amp;nbsp; suggest you can try to write the &lt;SPAN&gt;max timestamp&amp;nbsp;into a csv file ( WITH APPEND )&amp;nbsp; and at the end of the process you can read this file and&amp;nbsp; write into a SQL table .&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;HImanshu&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Nov 2023 18:40:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Warehouse/Warehouse-Parallel-update-on-status-table-fails/m-p/3515074#M560</guid>
      <dc:creator>HimanshuS-msft</dc:creator>
      <dc:date>2023-11-03T18:40:38Z</dc:date>
    </item>
    <item>
      <title>Re: Warehouse: Parallel update on status table fails</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Warehouse/Warehouse-Parallel-update-on-status-table-fails/m-p/3517752#M562</link>
      <description>&lt;P&gt;Hi Himanshu,&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for the (unfortunately very ugly) workaround. i will test this approach.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2023 12:58:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Warehouse/Warehouse-Parallel-update-on-status-table-fails/m-p/3517752#M562</guid>
      <dc:creator>cw88</dc:creator>
      <dc:date>2023-11-06T12:58:55Z</dc:date>
    </item>
    <item>
      <title>Re: Warehouse: Parallel update on status table fails</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Warehouse/Warehouse-Parallel-update-on-status-table-fails/m-p/3518078#M563</link>
      <description>&lt;P&gt;As I mentioned previously, INSERTs have very minimal chance of locking so I would just only insert into your status table&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2023 15:52:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Warehouse/Warehouse-Parallel-update-on-status-table-fails/m-p/3518078#M563</guid>
      <dc:creator>AndyDDC</dc:creator>
      <dc:date>2023-11-06T15:52:05Z</dc:date>
    </item>
  </channel>
</rss>

