<?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 Updating the database from JavaDelegate in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/updating-the-database-from-javadelegate/m-p/91420#M62392</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I don't know if there is a way to do what I want…&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have an async service task for executing several commands configured by the user. For example: create new file, copy, or delete a file…&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If one of the commands fails in execution I throw a exception, but when the task is restarted I need to know what commands were successful because I don want executing them again.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried to do this setting a variable with my command identifier in my DelegateExecution with boolean value. But I noticed that this variable is not really stored until the execution is ended. So, if the execution is interrupted I never has that variable. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So, I tried as well to set it calling a rest service from my JavaDelagate that make it through RuntimeService &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;runtimeService.setVariable(executionId, variableName, value);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now I can see that the database is updated but when the service task execution ends I get the error&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Exception in thread "pool-2-thread-3" org.apache.ibatis.exceptions.PersistenceException: &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; ### Error updating database.&amp;nbsp; Cause: java.sql.SQLIntegrityConstraintViolationException: ORA-02292: restricci?n de integridad (IBAP8.ACT_FK_VAR_EXE) violada - registro secundario encontrado&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And the thread continues alive…&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There is a way to do what I want??&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 26 Sep 2012 08:43:07 GMT</pubDate>
    <dc:creator>rodiaz</dc:creator>
    <dc:date>2012-09-26T08:43:07Z</dc:date>
    <item>
      <title>Updating the database from JavaDelegate</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/updating-the-database-from-javadelegate/m-p/91420#M62392</link>
      <description>Hi all,I don't know if there is a way to do what I want…I have an async service task for executing several commands configured by the user. For example: create new file, copy, or delete a file…If one of the commands fails in execution I throw a exception, but when the task is restarted I need to kno</description>
      <pubDate>Wed, 26 Sep 2012 08:43:07 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/updating-the-database-from-javadelegate/m-p/91420#M62392</guid>
      <dc:creator>rodiaz</dc:creator>
      <dc:date>2012-09-26T08:43:07Z</dc:date>
    </item>
    <item>
      <title>Re: Updating the database from JavaDelegate</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/updating-the-database-from-javadelegate/m-p/91421#M62393</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The transaction is only committed at the end of the command, indeed and variable-updates only flushed at the end of the command. You CANNOT later process state (e.g.. set a variable) from another transaction, when the process is flowing. So setting a variable in the process should be done on the delegate itself. This is the way activiti works. If you want to store stuff that doesn't play with the activiti-transactions (ie. is not rolled back when something goes wrong) you should use a separate db-table with separate transaction…&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Sep 2012 14:53:27 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/updating-the-database-from-javadelegate/m-p/91421#M62393</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2012-09-27T14:53:27Z</dc:date>
    </item>
  </channel>
</rss>

