<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Avoid concurrent updates from Related action</title><link>https://community.appian.com/discussions/f/general/12811/avoid-concurrent-updates-from-related-action</link><description>Hi, 
 Please suggest different and effective ways through which I can avoid multiple users accessing same related action to update records . 
 Thanks 
 Namrata</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Avoid concurrent updates from Related action</title><link>https://community.appian.com/thread/57532?ContentTypeID=1</link><pubDate>Wed, 04 Jul 2018 10:23:46 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ef56e862-1bca-46b1-9113-d1891f6cfdb6</guid><dc:creator>PhilB</dc:creator><description>&lt;p&gt;@paragk998 Is correct, but this thread is missing a &lt;a href="https://docs.appian.com/suite/help/18.2/Database_Schema_Best_Practices.html#optimistic-locking"&gt;link to the documentation&lt;/a&gt;! :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Avoid concurrent updates from Related action</title><link>https://community.appian.com/thread/57504?ContentTypeID=1</link><pubDate>Tue, 03 Jul 2018 14:05:15 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f31c6572-e373-4043-bb04-c6c3fba1b81e</guid><dc:creator>Jim Schweitzer</dc:creator><description>@Version is only really helpful as a failsafe, IMO. It doesn&amp;#39;t allow for a good user experience. It will throw an error when trying to save that may or may not be visible to the end user, so it&amp;#39;s better to implement some form of locking proactively and build a good UI around it.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Avoid concurrent updates from Related action</title><link>https://community.appian.com/thread/57498?ContentTypeID=1</link><pubDate>Tue, 03 Jul 2018 13:04:15 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:21d3ce63-dbbc-408c-9167-b311474593f2</guid><dc:creator>paragk998</dc:creator><description>Hi Namrata,&lt;br /&gt;
&lt;br /&gt;
you can use @Version (case sensitive) to achieve this.&lt;br /&gt;
just need to add @Version in column jpa annotation&lt;br /&gt;
eg.&lt;br /&gt;
 &amp;lt;xsd:element name=&amp;quot;id&amp;quot; nillable=&amp;quot;true&amp;quot; type=&amp;quot;xsd:int&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;xsd:annotation&amp;gt;&lt;br /&gt;
          &amp;lt;xsd:appinfo source=&amp;quot;appian.jpa&amp;quot;&amp;gt; @Id @GeneratedValue @Version &amp;lt;/xsd:appinfo&amp;gt;&lt;br /&gt;
        &amp;lt;/xsd:annotation&amp;gt;&lt;br /&gt;
      &amp;lt;/xsd:element&amp;gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Avoid concurrent updates from Related action</title><link>https://community.appian.com/thread/57496?ContentTypeID=1</link><pubDate>Tue, 03 Jul 2018 12:17:02 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:87360715-1543-42ee-a7d3-40632cd128dd</guid><dc:creator>Pradeep Gudishana</dc:creator><description>add one integer field in cdt and annotate that field with @version, this field will generate a integer value and this will be auto incremented for every update operation done on that particular row(record)&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Avoid concurrent updates from Related action</title><link>https://community.appian.com/thread/57492?ContentTypeID=1</link><pubDate>Tue, 03 Jul 2018 11:53:38 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1be7e039-8e75-4663-859b-d3f7b624b9c2</guid><dc:creator>namratak356</dc:creator><description>&lt;a href="/members/pradeepg0001"&gt;Pradeep Gudishana&lt;/a&gt;  Could you please elaborate your answer, How can I achieve lock functoinality using @ version JPA annotation in cdt.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Avoid concurrent updates from Related action</title><link>https://community.appian.com/thread/57481?ContentTypeID=1</link><pubDate>Tue, 03 Jul 2018 04:48:42 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:168c4959-1a09-4e2f-9111-730faa9540b1</guid><dc:creator>Pradeep Gudishana</dc:creator><description>Hi Namrata,&lt;br /&gt;
&lt;br /&gt;
Instead, use @version attribute in your cdt which will hold auto lock and raises exception when some others try to modify the same record&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Avoid concurrent updates from Related action</title><link>https://community.appian.com/thread/57456?ContentTypeID=1</link><pubDate>Mon, 02 Jul 2018 09:35:36 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e62e0ddb-79d7-4667-ba72-7629d735f4a6</guid><dc:creator>Shanmukha</dc:creator><description>Hi Namrata,&lt;br /&gt;
&lt;br /&gt;
We can also do it in the following way for safe retrieval. Along with flag we can also have who has locked the data. For instance if user A has already locked and he did not attend the task for a week then user B wants to update same data during that week it may create a problem. So for this we can have user name who have locked it then User B will notify User A  that he wants to update the record so please release the lock. If the user A is not responding for some time then we can have another Related Action called Release the Lock. This new related action can only be shown when the user A has locked it for respected amount of time. I know it&amp;#39;s big work around but this may help user to take any action based on the critical situations.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Avoid concurrent updates from Related action</title><link>https://community.appian.com/thread/57443?ContentTypeID=1</link><pubDate>Mon, 02 Jul 2018 06:54:29 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:50d7e267-97c5-4eb1-9c94-f5ed8c86af59</guid><dc:creator>abishekk109</dc:creator><description>Hi,&lt;br /&gt;
&lt;br /&gt;
Use a flag as suggested below in your database to ensure that whether the action is accepted by any other user in the specific group. That way you can ensure the above discussion.&lt;br /&gt;
&lt;br /&gt;
Thanks,&lt;br /&gt;
Abishek&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Avoid concurrent updates from Related action</title><link>https://community.appian.com/thread/57421?ContentTypeID=1</link><pubDate>Fri, 29 Jun 2018 17:57:20 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:59a2a97b-4c23-4de2-9666-331b03d06e9e</guid><dc:creator>Jim Schweitzer</dc:creator><description>You can also accomplish something similar to what Mike is suggesting by using process analytics. If you have your related actions start a process instead of using a start form, you can use queryprocessananalytics to see if there are any active processes with whatever metadata you track for your record. This may or may not perform better depending on the rest of the structure of your app, but can help avoid database calls to write the locks.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Avoid concurrent updates from Related action</title><link>https://community.appian.com/thread/57420?ContentTypeID=1</link><pubDate>Fri, 29 Jun 2018 17:18:40 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d47916a1-a172-4abd-98a5-1cf1ebe5b098</guid><dc:creator>Mike Schmitt</dc:creator><description>The one technique I&amp;#39;ve seen used successfully is to include a database column, i.e. &amp;quot;isLocked&amp;quot; (boolean), which gets set to TRUE as soon as a user initiates a particular related action, and the same gets set back to FALSE when the related action is concluded or timed out.  And if any user attempts to start the related action while the &amp;quot;locked&amp;quot; value is true, they&amp;#39;re diverted away, perhaps to a task telling them that this record is locked.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>