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]