I’m new to Camunda and trying to test drive it. I am using:
Camunda BPM: (v7.9.0-alpha3)
Camunda Spring Boot Starter-Rest: (v3.0.0-alpha1)
H2-DB
The test process is very simple: start - 2 external tasks - end.
After deploying it, I use a REST client to start/fectchAndLock/complete a few thousand process instances and then get many exceptions. It seems the batch deletion order is wrong.
2018-05-12 20:14:44.324 ERROR 10478 — [nio-8080-exec-7] org.camunda.bpm.engine.context : ENGINE-16004 Exception while closing command context: ENGINE-03083 Exception while executing Batch Database Operations with message ’
Error flushing statements. Cause: org.apache.ibatis.executor.BatchExecutorException: org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.deleteExecution (batch index #4) failed. 3 prior sub executor(s) completed successfully, but will be rolled back. Cause: org.h2.jdbc.JdbcBatchUpdateException: Referential integrity constraint violation: “ACT_FK_EXE_PROCINST: PUBLIC.ACT_RU_EXECUTION FOREIGN KEY(PROC_INST_ID_) REFERENCES PUBLIC.ACT_RU_EXECUTION(ID_) (‘0c06e861-55de-11e8-9e9f-0242ef8473e1’)”; SQL statement:
delete from ACT_RU_EXECUTION where ID_ = ? and REV_ = ? [23503-196]
Cause: org.apache.ibatis.executor.BatchExecutorException: org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.deleteExecution (batch index #4) failed. 3 prior sub executor(s) completed successfully, but will be rolled back. Cause: org.h2.jdbc.JdbcBatchUpdateException: Referential integrity constraint violation: “ACT_FK_EXE_PROCINST: PUBLIC.ACT_RU_EXECUTION FOREIGN KEY(PROC_INST_ID_) REFERENCES PUBLIC.ACT_RU_EXECUTION(ID_) (‘0c06e861-55de-11e8-9e9f-0242ef8473e1’)”; SQL statement:
delete from ACT_RU_EXECUTION where ID_ = ? and REV_ = ? [23503-196]
org.h2.jdbc.JdbcBatchUpdateException: Referential integrity constraint violation: “ACT_FK_EXE_PROCINST: PUBLIC.ACT_RU_EXECUTION FOREIGN KEY(PROC_INST_ID_) REFERENCES PUBLIC.ACT_RU_EXECUTION(ID_) (‘0c06e861-55de-11e8-9e9f-0242ef8473e1’)”; SQL statement:
delete from ACT_RU_EXECUTION where ID_ = ? and REV_ = ? [23503-196]
org.h2.jdbc.JdbcSQLException: Referential integrity constraint violation: “ACT_FK_EXE_PROCINST: PUBLIC.ACT_RU_EXECUTION FOREIGN KEY(PROC_INST_ID_) REFERENCES PUBLIC.ACT_RU_EXECUTION(ID_) (‘0c06e861-55de-11e8-9e9f-0242ef8473e1’)”; SQL statement:
delete from ACT_RU_EXECUTION where ID_ = ? and REV_ = ? [23503-196]
org.h2.jdbc.JdbcSQLException: Referential integrity constraint violation: “ACT_FK_EXT_TASK_EXE: PUBLIC.ACT_RU_EXT_TASK FOREIGN KEY(EXECUTION_ID_) REFERENCES PUBLIC.ACT_RU_EXECUTION(ID_) (‘0cc333d3-55de-11e8-9e9f-0242ef8473e1’)”; SQL statement:
delete from ACT_RU_EXECUTION where ID_ = ? and REV_ = ? [23503-196]
'. Flush summary:
[
INSERT HistoricExternalTaskLogEntity[0dc67336-55de-11e8-9e9f-0242ef8473e1]
INSERT HistoricActivityInstanceEventEntity[EndEvent_14h6lw0:0dc67337-55de-11e8-9e9f-0242ef8473e1]
DELETE ExternalTaskEntity[0cc333d5-55de-11e8-9e9f-0242ef8473e1]
DELETE ExecutionEntity[0cc333d3-55de-11e8-9e9f-0242ef8473e1]
DELETE ExecutionEntity[0c06e861-55de-11e8-9e9f-0242ef8473e1]
UPDATE HistoricActivityInstanceEventEntity[Task_0pvkpo3:0cc333d4-55de-11e8-9e9f-0242ef8473e1]
UPDATE HistoricProcessInstanceEventEntity[0c06e861-55de-11e8-9e9f-0242ef8473e1]
]
org.camunda.bpm.engine.ProcessEngineException: ENGINE-03083 Exception while executing Batch Database Operations with message ’
Error flushing statements. Cause: org.apache.ibatis.executor.BatchExecutorException: org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.deleteExecution (batch index #4) failed. 3 prior sub executor(s) completed successfully, but will be rolled back. Cause: org.h2.jdbc.JdbcBatchUpdateException: Referential integrity constraint violation: “ACT_FK_EXE_PROCINST: PUBLIC.ACT_RU_EXECUTION FOREIGN KEY(PROC_INST_ID_) REFERENCES PUBLIC.ACT_RU_EXECUTION(ID_) (‘0c06e861-55de-11e8-9e9f-0242ef8473e1’)”; SQL statement:
delete from ACT_RU_EXECUTION where ID_ = ? and REV_ = ? [23503-196]
Cause: org.apache.ibatis.executor.BatchExecutorException: org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.deleteExecution (batch index #4) failed. 3 prior sub executor(s) completed successfully, but will be rolled back. Cause: org.h2.jdbc.JdbcBatchUpdateException: Referential integrity constraint violation: “ACT_FK_EXE_PROCINST: PUBLIC.ACT_RU_EXECUTION FOREIGN KEY(PROC_INST_ID_) REFERENCES PUBLIC.ACT_RU_EXECUTION(ID_) (‘0c06e861-55de-11e8-9e9f-0242ef8473e1’)”; SQL statement:
delete from ACT_RU_EXECUTION where ID_ = ? and REV_ = ? [23503-196]
org.h2.jdbc.JdbcBatchUpdateException: Referential integrity constraint violation: “ACT_FK_EXE_PROCINST: PUBLIC.ACT_RU_EXECUTION FOREIGN KEY(PROC_INST_ID_) REFERENCES PUBLIC.ACT_RU_EXECUTION(ID_) (‘0c06e861-55de-11e8-9e9f-0242ef8473e1’)”; SQL statement:
delete from ACT_RU_EXECUTION where ID_ = ? and REV_ = ? [23503-196]
org.h2.jdbc.JdbcSQLException: Referential integrity constraint violation: “ACT_FK_EXE_PROCINST: PUBLIC.ACT_RU_EXECUTION FOREIGN KEY(PROC_INST_ID_) REFERENCES PUBLIC.ACT_RU_EXECUTION(ID_) (‘0c06e861-55de-11e8-9e9f-0242ef8473e1’)”; SQL statement:
delete from ACT_RU_EXECUTION where ID_ = ? and REV_ = ? [23503-196]
org.h2.jdbc.JdbcSQLException: Referential integrity constraint violation: “ACT_FK_EXT_TASK_EXE: PUBLIC.ACT_RU_EXT_TASK FOREIGN KEY(EXECUTION_ID_) REFERENCES PUBLIC.ACT_RU_EXECUTION(ID_) (‘0cc333d3-55de-11e8-9e9f-0242ef8473e1’)”; SQL statement:
delete from ACT_RU_EXECUTION where ID_ = ? and REV_ = ? [23503-196]
'. Flush summary:
[
INSERT HistoricExternalTaskLogEntity[0dc67336-55de-11e8-9e9f-0242ef8473e1]
INSERT HistoricActivityInstanceEventEntity[EndEvent_14h6lw0:0dc67337-55de-11e8-9e9f-0242ef8473e1]
DELETE ExternalTaskEntity[0cc333d5-55de-11e8-9e9f-0242ef8473e1]
DELETE ExecutionEntity[0cc333d3-55de-11e8-9e9f-0242ef8473e1]
DELETE ExecutionEntity[0c06e861-55de-11e8-9e9f-0242ef8473e1]
UPDATE HistoricActivityInstanceEventEntity[Task_0pvkpo3:0cc333d4-55de-11e8-9e9f-0242ef8473e1]
UPDATE HistoricProcessInstanceEventEntity[0c06e861-55de-11e8-9e9f-0242ef8473e1]
]
at org.camunda.bpm.engine.impl.db.EnginePersistenceLogger.flushDbOperationsException(EnginePersistenceLogger.java:697) ~[camunda-engine-7.9.0-alpha3.jar!/:7.9.0-alpha3]
at org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager.flushDbOperations(DbEntityManager.java:355) ~[camunda-engine-7.9.0-alpha3.jar!/:7.9.0-alpha3]
at org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager.flushDbOperationManager(DbEntityManager.java:318) ~[camunda-engine-7.9.0-alpha3.jar!/:7.9.0-alpha3]
at org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager.flush(DbEntityManager.java:290) ~[camunda-engine-7.9.0-alpha3.jar!/:7.9.0-alpha3]
at org.camunda.bpm.engine.impl.interceptor.CommandContext.flushSessions(CommandContext.java:203) ~[camunda-engine-7.9.0-alpha3.jar!/:7.9.0-alpha3]
at org.camunda.bpm.engine.impl.interceptor.CommandContext.close(CommandContext.java:132) ~[camunda-engine-7.9.0-alpha3.jar!/:7.9.0-alpha3]
at org.camunda.bpm.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:113) [camunda-engine-7.9.0-alpha3.jar!/:7.9.0-alpha3]
at org.camunda.bpm.engine.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:42) [camunda-engine-spring-7.9.0-alpha3.jar!/:7.9.0-alpha3]
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140) [spring-tx-5.0.4.RELEASE.jar!/:5.0.4.RELEASE]
at org.camunda.bpm.engine.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:40) [camunda-engine-spring-7.9.0-alpha3.jar!/:7.9.0-alpha3]
at org.camunda.bpm.engine.impl.interceptor.ProcessApplicationContextInterceptor.execute(ProcessApplicationContextInterceptor.java:66) [camunda-engine-7.9.0-alpha3.jar!/:7.9.0-alpha3]
at org.camunda.bpm.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:30) [camunda-engine-7.9.0-alpha3.jar!/:7.9.0-alpha3]
at org.camunda.bpm.engine.impl.ExternalTaskServiceImpl.complete(ExternalTaskServiceImpl.java:52) [camunda-engine-7.9.0-alpha3.jar!/:7.9.0-alpha3]
at org.camunda.bpm.engine.rest.sub.externaltask.impl.ExternalTaskResourceImpl.complete(ExternalTaskResourceImpl.java:108) [camunda-engine-rest-core-7.9.0-alpha3.jar!/:7.9.0-alpha3]
at sun.reflect.GeneratedMethodAccessor218.invoke(Unknown Source) ~[na:na]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_162]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_162]
at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:76) [jersey-server-2.26.jar!/:na]
… …
there are many more stack traces, but I think they are irrelevant to this problem.
Kelvin