<?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 Unable to complete parallel task (foreign key violation) in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/unable-to-complete-parallel-task-foreign-key-violation/m-p/99032#M68374</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a problem that seems like a bug, but I'm not sure - maybe I'm doing something wrong.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have two parallel tasks. During the execution some variables are added to the tasks using&lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG&gt;taskService.setVariableLocal(taskId, variable, value)&lt;/STRONG&gt;&lt;SPAN&gt;. And now when I call &lt;/SPAN&gt;&lt;STRONG&gt;taskService.complete(taskId)&lt;/STRONG&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;on one of the tasks, I get the following error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;org.apache.ibatis.exceptions.PersistenceException: ### Error updating database. Cause: org.postgresql.util.PSQLException: ERROR: update or delete on table "act_ru_execution" violates foreign key constraint "act_fk_var_exe" on table "act_ru_variable" Detail: Key (id_)=(17126) is still referenced from table "act_ru_variable". ### The error may involve org.activiti.engine.impl.persistence.entity.ExecutionEntity.deleteExecution-Inline ### The error occurred while setting parameters ### SQL: delete from ACT_RU_EXECUTION where ID_ = ? ### Cause: org.postgresql.util.PSQLException: ERROR: update or delete on table "act_ru_execution" violates foreign key constraint "act_fk_var_exe" on table "act_ru_variable" Detail: Key (id_)=(17126) is still referenced from table "act_ru_variable".&lt;BR /&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Table &lt;/SPAN&gt;&lt;STRONG&gt;act_ru_variable&lt;/STRONG&gt;&lt;SPAN&gt; has a FOREIGN_KEY that references to &lt;/SPAN&gt;&lt;STRONG&gt;act_ru_execution&lt;/STRONG&gt;&lt;SPAN&gt; (id_).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;And it seems that when I set the task to be complete(), then Activity tries to delete the execution from &lt;/SPAN&gt;&lt;STRONG&gt;act_ru_execution&lt;/STRONG&gt;&lt;SPAN&gt; before it deletes the task variables from &lt;/SPAN&gt;&lt;STRONG&gt;act_ru_variables&lt;/STRONG&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is this a bug? Or has anyone ideas how to solve this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Can I remove the foreign key - or does it mess up other things?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Many thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Risto&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 24 Aug 2012 08:35:28 GMT</pubDate>
    <dc:creator>risto45</dc:creator>
    <dc:date>2012-08-24T08:35:28Z</dc:date>
    <item>
      <title>Unable to complete parallel task (foreign key violation)</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/unable-to-complete-parallel-task-foreign-key-violation/m-p/99032#M68374</link>
      <description>I have a problem that seems like a bug, but I'm not sure - maybe I'm doing something wrong.I have two parallel tasks. During the execution some variables are added to the tasks usingtaskService.setVariableLocal(taskId, variable, value). And now when I call taskService.complete(taskId) on one of the</description>
      <pubDate>Fri, 24 Aug 2012 08:35:28 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/unable-to-complete-parallel-task-foreign-key-violation/m-p/99032#M68374</guid>
      <dc:creator>risto45</dc:creator>
      <dc:date>2012-08-24T08:35:28Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to complete parallel task (foreign key violation)</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/unable-to-complete-parallel-task-foreign-key-violation/m-p/99033#M68375</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi risto45,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;sounds like a bug. Could you maybe open an issue in JIRA and include a testcase?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Aug 2012 12:28:22 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/unable-to-complete-parallel-task-foreign-key-violation/m-p/99033#M68375</guid>
      <dc:creator>meyerd</dc:creator>
      <dc:date>2012-08-24T12:28:22Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to complete parallel task (foreign key violation)</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/unable-to-complete-parallel-task-foreign-key-violation/m-p/99034#M68376</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Actually there is already an issue opened in JIRA with similar problem.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I simply updated it: &lt;/SPAN&gt;&lt;A href="https://jira.codehaus.org/browse/ACT-1054" rel="nofollow noopener noreferrer"&gt;https://jira.codehaus.org/browse/ACT-1054&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Rgs,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Risto&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Aug 2012 12:50:06 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/unable-to-complete-parallel-task-foreign-key-violation/m-p/99034#M68376</guid>
      <dc:creator>risto45</dc:creator>
      <dc:date>2012-08-24T12:50:06Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to complete parallel task (foreign key violation)</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/unable-to-complete-parallel-task-foreign-key-violation/m-p/99035#M68377</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I described the FOREIGN KEY violation a little wrong earlier.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What really happens is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;When I have a parallel task that contains two separate tasks: T1 and T2.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;When T1 an T2 are executed, T1 gets execution ID 01 and T2 gets execution ID 02.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Now, during the execution I set couple of local variables for both, T1 and T2.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;And when I set for example that T2 is completed (taskService.complete(T2.getId()), Activiti for some reason tries to delete &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;both executions 01 and 02. Allthough I guess it should only delete execution 02.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;And since there are still local variable for T1 in &lt;/SPAN&gt;&lt;STRONG&gt;act_ru_variable&lt;/STRONG&gt;&lt;SPAN&gt; table, then system throws error: FOREIGN KEY violation.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Can't delete execution that has a local variables in &lt;/SPAN&gt;&lt;STRONG&gt;act_ru_variable&lt;/STRONG&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I have a parallel task and I want to set one of them completed, why it tries to delete both executions?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Seems like a very common requirement? Can there really be such a bug. Or maybe I'm just doing something wrong.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Rgs,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Risto&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Aug 2012 09:25:50 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/unable-to-complete-parallel-task-foreign-key-violation/m-p/99035#M68377</guid>
      <dc:creator>risto45</dc:creator>
      <dc:date>2012-08-27T09:25:50Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to complete parallel task (foreign key violation)</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/unable-to-complete-parallel-task-foreign-key-violation/m-p/99036#M68378</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Any news on this? Did anyone mange to find a work around? May be delete the foreign key var or something?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;10x all&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Sep 2012 09:41:07 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/unable-to-complete-parallel-task-foreign-key-violation/m-p/99036#M68378</guid>
      <dc:creator>roig</dc:creator>
      <dc:date>2012-09-05T09:41:07Z</dc:date>
    </item>
  </channel>
</rss>

