Error while setting execution variables

Hi. I have a spring boot project (1.5.10) in which I have integrated camunda engine using the camunda-engine-spring (7.10.0) dependency. This project uses MySQL as the database.

I have deployed a process in which there is a service task where I set a variable using a delegate, which is followed by a gateway where the aforementioned variable is checked.

I am encountering random errors (not always) while executing this process. The following are the stack trace for the errors.

  • First error
    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 #10) failed. 9 prior sub executor(s) completed successfully, but will be rolled back. Cause: java.sql.BatchUpdateException: Cannot delete or update a parent row: a foreign key constraint fails (camunda.ACT_RU_TASK, CONSTRAINT ACT_FK_TASK_EXE FOREIGN KEY (EXECUTION_ID_) REFERENCES ACT_RU_EXECUTION (ID_)) ### Cause: org.apache.ibatis.executor.BatchExecutorException: org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.deleteExecution (batch index #10) failed. 9 prior sub executor(s) completed successfully, but will be rolled back. Cause: java.sql.BatchUpdateException: Cannot delete or update a parent row: a foreign key constraint fails (camunda.ACT_RU_TASK, CONSTRAINT ACT_FK_TASK_EXE FOREIGN KEY (EXECUTION_ID_) REFERENCES ACT_RU_EXECUTION (ID_)) java.sql.BatchUpdateException: Cannot delete or update a parent row: a foreign key constraint fails (camunda.ACT_RU_TASK, CONSTRAINT ACT_FK_TASK_EXE FOREIGN KEY (EXECUTION_ID_) REFERENCES ACT_RU_EXECUTION (ID_)) '. Flush summary: [ INSERT ExecutionEntity[1573752] INSERT TaskEntity[1573762] INSERT ByteArrayEntity[1573754] INSERT ByteArrayEntity[1573756] INSERT ByteArrayEntity[1573758] INSERT ByteArrayEntity[1573760] INSERT VariableInstanceEntity[1573755] INSERT VariableInstanceEntity[1573757] INSERT VariableInstanceEntity[1573759] INSERT VariableInstanceEntity[1573761] UPDATE VariableInstanceEntity[1567965] UPDATE VariableInstanceEntity[1567966] UPDATE VariableInstanceEntity[1567967] UPDATE VariableInstanceEntity[1567968] UPDATE VariableInstanceEntity[1567976] UPDATE VariableInstanceEntity[1573503] DELETE VariableInstanceEntity[1573723] DELETE VariableInstanceEntity[1573725] DELETE VariableInstanceEntity[1573727] DELETE VariableInstanceEntity[1573729] DELETE ByteArrayEntity[1573722] DELETE ByteArrayEntity[1573724] DELETE ByteArrayEntity[1573726] DELETE ByteArrayEntity[1573728] DELETE TaskEntity[1573730] UPDATE ExecutionEntity[1567973] DELETE ExecutionEntity[1573720] ]

  • Second error
    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.VariableInstanceEntity.updateVariableInstance (batch index #5) failed. 4 prior sub executor(s) completed successfully, but will be rolled back. Cause: java.sql.BatchUpdateException: Deadlock found when trying to get lock; try restarting transaction ### Cause: org.apache.ibatis.executor.BatchExecutorException: org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceEntity.updateVariableInstance (batch index #5) failed. 4 prior sub executor(s) completed successfully, but will be rolled back. Cause: java.sql.BatchUpdateException: Deadlock found when trying to get lock; try restarting transaction java.sql.BatchUpdateException: Deadlock found when trying to get lock; try restarting transaction '. Flush summary: [ INSERT ExecutionEntity[1574962] INSERT TaskEntity[1574978] INSERT ByteArrayEntity[1574966] INSERT ByteArrayEntity[1574968] INSERT ByteArrayEntity[1574974] INSERT ByteArrayEntity[1574976] INSERT VariableInstanceEntity[1574967] INSERT VariableInstanceEntity[1574969] INSERT VariableInstanceEntity[1574975] INSERT VariableInstanceEntity[1574977] UPDATE VariableInstanceEntity[1574373] UPDATE VariableInstanceEntity[1574374] UPDATE VariableInstanceEntity[1574375] UPDATE VariableInstanceEntity[1574376] UPDATE VariableInstanceEntity[1574384] UPDATE VariableInstanceEntity[1574635] DELETE VariableInstanceEntity[1574936] DELETE VariableInstanceEntity[1574938] DELETE VariableInstanceEntity[1574940] DELETE VariableInstanceEntity[1574942] DELETE ByteArrayEntity[1574935] DELETE ByteArrayEntity[1574937] DELETE ByteArrayEntity[1574939] DELETE ByteArrayEntity[1574941] DELETE TaskEntity[1574943] UPDATE ExecutionEntity[1574381] DELETE ExecutionEntity[1574933] ]

These errors occur randomly and what is worse is that they don’t occur all the time. Sometimes the process executes without any error.

I am not sure what seems to be the problem, and the error logs are not proving to be helpful.
Any help is appreciated.

Please check the compatibility matrix, 7.10 does not work for 1.5.x

https://docs.camunda.org/manual/7.13/user-guide/spring-boot-integration/version-compatibility/

You will have to update spring boot

1 Like