cancel
Showing results for 
Search instead for 
Did you mean: 

Cancel boundary event leads to violates foreign key constraint 'act_fk_task_exe' on table 'act_ru_task' for async user tasks

michael_wray
Champ in-the-making
Champ in-the-making
We're using 5.19 and we noticed that when we have a cancel boundary event on an embedded subprocess that includes user tasks which have activiti:async="true", when the boundary event fires, we get the following exception in the log:

2016-03-09 09:31:14.011 ERROR 6188 — [SimpleAsyncTaskExecutor-14] o.a.e.i.a.ExecuteAsyncRunnable           : Job 475091 failed

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_task_exe" on table "act_ru_task"
  Detail: Key (id_)=(475090) is still referenced from table "act_ru_task".
### 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_ = ? and REV_ = ?
### Cause: org.postgresql.util.PSQLException: ERROR: update or delete on table "act_ru_execution" violates foreign key constraint "act_fk_task_exe" on table "act_ru_task"
  Detail: Key (id_)=(475090) is still referenced from table "act_ru_task".
   at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:23) ~[mybatis-3.2.5.jar!/:3.2.5]
   at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:150) ~[mybatis-3.2.5.jar!/:3.2.5]
   at org.apache.ibatis.session.defaults.DefaultSqlSession.delete(DefaultSqlSession.java:161) ~[mybatis-3.2.5.jar!/:3.2.5]
   at org.activiti.engine.impl.db.DbSqlSession$CheckedDeleteOperation.execute(DbSqlSession.java:293) ~[activiti-engine-5.19.0.jar!/:5.19.0]
   at org.activiti.engine.impl.db.DbSqlSession.flushRegularDeletes(DbSqlSession.java:922) ~[activiti-engine-5.19.0.jar!/:5.19.0]
   at org.activiti.engine.impl.db.DbSqlSession.flushDeletes(DbSqlSession.java:888) ~[activiti-engine-5.19.0.jar!/:5.19.0]
4 REPLIES 4

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi,

Could you create jUnit test please?
https://forums.activiti.org/content/sticky-how-write-unit-test

Regards
Martin

jim1
Champ on-the-rise
Champ on-the-rise
Hi,
I work with Mike and have created a unit test to recreate the issue: https://goo.gl/AO5E7W

The test fails as the timer doesn't complete in the allowed time due to the error we are seeing, you can see the exception mentioned above in the logs.

Thanks,
Jim.

jbarrez
Star Contributor
Star Contributor
Tested this on the latest version (5.19.0.2) and there it works. It indeed fails on 5.19.0, so I'd advise to upgrade 🙂

it also works on v6 (of course 😉 )

jim1
Champ on-the-rise
Champ on-the-rise
Ah, excellent. Thanks for the quick response, we'll look into upgrading.
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.