<?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: Why AuthenticationUtil.runAs() ? in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/why-authenticationutil-runas/m-p/259888#M213018</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Why indeed!&amp;nbsp; I agree that the lock service is a little tricky to use, in fact I raised a JIRA enhancement request to rework it.&amp;nbsp;&amp;nbsp; You could vote for it if you agree.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As for your second point all code within alfresco needs to be within a retrying transaction handler.&amp;nbsp;&amp;nbsp;&amp;nbsp; For performance reasons Alfresco uses optimistic locking which in general means that everything needs to be retried after a relativly rare concurrency error.&amp;nbsp;&amp;nbsp; The good news is that the RetryingTransactionHandler does this for you and most of the interfaces, in particular web scripts, already automatically retry. &lt;/SPAN&gt;&lt;A href="http://en.wikipedia.org/wiki/Optimistic_concurrency_control" rel="nofollow noopener noreferrer"&gt;http://en.wikipedia.org/wiki/Optimistic_concurrency_control&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 25 Jul 2011 14:59:12 GMT</pubDate>
    <dc:creator>mrogers</dc:creator>
    <dc:date>2011-07-25T14:59:12Z</dc:date>
    <item>
      <title>Why AuthenticationUtil.runAs() ?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/why-authenticationutil-runas/m-p/259887#M213017</link>
      <description>Question for all,When i'm trying to locking a node for edit its properties, the lock was throw an exception as well as there is no User Context.To set the user context i write the following snipe of code &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;AuthenticationUtil.runAs(new RunAsWork&amp;lt;String&amp;gt;(){&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public String doWork()thro</description>
      <pubDate>Mon, 25 Jul 2011 14:11:59 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/why-authenticationutil-runas/m-p/259887#M213017</guid>
      <dc:creator>mohammed_amr</dc:creator>
      <dc:date>2011-07-25T14:11:59Z</dc:date>
    </item>
    <item>
      <title>Re: Why AuthenticationUtil.runAs() ?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/why-authenticationutil-runas/m-p/259888#M213018</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Why indeed!&amp;nbsp; I agree that the lock service is a little tricky to use, in fact I raised a JIRA enhancement request to rework it.&amp;nbsp;&amp;nbsp; You could vote for it if you agree.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As for your second point all code within alfresco needs to be within a retrying transaction handler.&amp;nbsp;&amp;nbsp;&amp;nbsp; For performance reasons Alfresco uses optimistic locking which in general means that everything needs to be retried after a relativly rare concurrency error.&amp;nbsp;&amp;nbsp; The good news is that the RetryingTransactionHandler does this for you and most of the interfaces, in particular web scripts, already automatically retry. &lt;/SPAN&gt;&lt;A href="http://en.wikipedia.org/wiki/Optimistic_concurrency_control" rel="nofollow noopener noreferrer"&gt;http://en.wikipedia.org/wiki/Optimistic_concurrency_control&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jul 2011 14:59:12 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/why-authenticationutil-runas/m-p/259888#M213018</guid>
      <dc:creator>mrogers</dc:creator>
      <dc:date>2011-07-25T14:59:12Z</dc:date>
    </item>
  </channel>
</rss>

