<?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: Prevent dirty reads in Alteryx in Alteryx Server Discussions</title>
    <link>https://community.alteryx.com/t5/Alteryx-Server-Discussions/Prevent-dirty-reads-in-Alteryx/m-p/754982#M8766</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.alteryx.com/t5/user/viewprofilepage/user-id/102561"&gt;@Morten&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not aware of a direct solution for that.&lt;/P&gt;&lt;P&gt;What I've already done was, to create in the pre and post SQL statement, a table with 2 columns, start (preSQL) and finish (postSQL), that way, if the finish is null I'm sure it is a table that is being currently updated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You have the option to create a counter to wait or to simply stop the process.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is not a pretty solution, but it does work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Fernando Vizcaino&lt;/P&gt;</description>
    <pubDate>Wed, 05 May 2021 15:09:01 GMT</pubDate>
    <dc:creator>fmvizcaino</dc:creator>
    <dc:date>2021-05-05T15:09:01Z</dc:date>
    <item>
      <title>Prevent dirty reads in Alteryx</title>
      <link>https://community.alteryx.com/t5/Alteryx-Server-Discussions/Prevent-dirty-reads-in-Alteryx/m-p/752994#M8764</link>
      <description>&lt;DIV class="p-rich_text_section"&gt;Case: I want to prevent reading from a database table that is being written to.&lt;/DIV&gt;&lt;DIV class="p-rich_text_section"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="p-rich_text_section"&gt;Problem: let’s say I have two workflows.&amp;nbsp;&lt;STRONG&gt;Workflow 1&amp;nbsp;&lt;/STRONG&gt;uses the regular output tool in Alteryx to write 1 million records to a table.&amp;nbsp;&lt;STRONG&gt;Workflow 2&lt;/STRONG&gt;&amp;nbsp;then starts reading from the same table that&lt;STRONG&gt;&amp;nbsp;workflow 1&lt;/STRONG&gt;&amp;nbsp;is writing to and this results in a dirty read –&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;workflow 2&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;only reads the number of records that were transmitted at the time of reading.&lt;/DIV&gt;&lt;DIV class="p-rich_text_section"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="p-rich_text_section"&gt;The way I understand the output tool is that it chunks up the writing session into smaller transactions (specified by the user) and finishes once the writing session completes. However, it doesn’t lock the table while writing and therefore dirty reads can happen if&amp;nbsp;&lt;STRONG&gt;workflow 2&lt;/STRONG&gt;&amp;nbsp;reads meanwhile&amp;nbsp;&lt;STRONG&gt;workflow 1&lt;/STRONG&gt;&amp;nbsp;is writing.&lt;/DIV&gt;&lt;DIV class="p-rich_text_section"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="p-rich_text_section"&gt;The situation occurs when workflows on the Alteryx server runs simultaneously.&lt;/DIV&gt;&lt;DIV class="p-rich_text_section"&gt;Note:&lt;/DIV&gt;&lt;UL&gt;&lt;LI&gt;In many cases workflows are executed in an extract, transform, load order to avoid concurrency problems. However, this is not possible as workflows need to be run at different schedules which have overlapping runtime.&lt;/LI&gt;&lt;LI&gt;DB runs on MSSQL&lt;/LI&gt;&lt;/UL&gt;&lt;DIV class="p-rich_text_section"&gt;I’ve tried&lt;/DIV&gt;&lt;UL&gt;&lt;LI&gt;Changing the isolation level on the database, but Alteryx ignore these.&lt;/LI&gt;&lt;LI&gt;Using locks in a pre-SQL statement, but they release right before the writing sessions start.&lt;/LI&gt;&lt;LI&gt;The SQL Server bulk loader protocol, but dirty reads still occur.&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Thu, 29 Apr 2021 15:38:53 GMT</pubDate>
      <guid>https://community.alteryx.com/t5/Alteryx-Server-Discussions/Prevent-dirty-reads-in-Alteryx/m-p/752994#M8764</guid>
      <dc:creator>Morten</dc:creator>
      <dc:date>2021-04-29T15:38:53Z</dc:date>
    </item>
    <item>
      <title>Re: Prevent dirty reads in Alteryx</title>
      <link>https://community.alteryx.com/t5/Alteryx-Server-Discussions/Prevent-dirty-reads-in-Alteryx/m-p/754982#M8766</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.alteryx.com/t5/user/viewprofilepage/user-id/102561"&gt;@Morten&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not aware of a direct solution for that.&lt;/P&gt;&lt;P&gt;What I've already done was, to create in the pre and post SQL statement, a table with 2 columns, start (preSQL) and finish (postSQL), that way, if the finish is null I'm sure it is a table that is being currently updated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You have the option to create a counter to wait or to simply stop the process.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is not a pretty solution, but it does work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Fernando Vizcaino&lt;/P&gt;</description>
      <pubDate>Wed, 05 May 2021 15:09:01 GMT</pubDate>
      <guid>https://community.alteryx.com/t5/Alteryx-Server-Discussions/Prevent-dirty-reads-in-Alteryx/m-p/754982#M8766</guid>
      <dc:creator>fmvizcaino</dc:creator>
      <dc:date>2021-05-05T15:09:01Z</dc:date>
    </item>
    <item>
      <title>Re: Prevent dirty reads in Alteryx</title>
      <link>https://community.alteryx.com/t5/Alteryx-Server-Discussions/Prevent-dirty-reads-in-Alteryx/m-p/756932#M8787</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi&amp;nbsp;Fernando Vizcaino,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you for sharing you solution.&amp;nbsp;I actually worked with the same idea, but went with something else, as it requires too much configuration for every time you need to input or output data.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Instead I use the in-db tools:&lt;BR /&gt;&lt;BR /&gt;First I use a &lt;STRONG&gt;data stream in&lt;/STRONG&gt; tool create a temp table. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Then i bulk upload to the table using &lt;STRONG&gt;write data in-db&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This prevents dirty reads and forces a native error, which I can use with a try-catch list-runner I made. However, It doesn't support pre and post sql statement, Update: insert if new and&amp;nbsp;data is not sorted.&lt;BR /&gt;&lt;BR /&gt;So still looking for a better solution..&lt;BR /&gt;&lt;BR /&gt;Thank you for sharing your solution, it is always nice to know, that other people thought something similar. So really appreciate it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Morten&lt;/P&gt;</description>
      <pubDate>Mon, 10 May 2021 16:08:39 GMT</pubDate>
      <guid>https://community.alteryx.com/t5/Alteryx-Server-Discussions/Prevent-dirty-reads-in-Alteryx/m-p/756932#M8787</guid>
      <dc:creator>Morten</dc:creator>
      <dc:date>2021-05-10T16:08:39Z</dc:date>
    </item>
    <item>
      <title>Re: Prevent dirty reads in Alteryx</title>
      <link>https://community.alteryx.com/t5/Alteryx-Server-Discussions/Prevent-dirty-reads-in-Alteryx/m-p/1320298#M15997</link>
      <description>&lt;P&gt;I came across this same situation. Here was my solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) When writing my data to a table in Workflow 1, I include a column with TotalRowCount, so each row has how many records I'm writing.&lt;/P&gt;&lt;P&gt;2) When pulled data from the table in Workflow 2, I include in the WHERE clause language such as: WHERE Table1.TotalRowCount = (SELECT Count(*) FROM Table1)&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2024 15:27:33 GMT</pubDate>
      <guid>https://community.alteryx.com/t5/Alteryx-Server-Discussions/Prevent-dirty-reads-in-Alteryx/m-p/1320298#M15997</guid>
      <dc:creator>JasonFortriede</dc:creator>
      <dc:date>2024-09-19T15:27:33Z</dc:date>
    </item>
  </channel>
</rss>

