Where to set jdbcbatchprocessing configuration?

We are running the standard docker distribution of Camunda with Tomcat and wish to test changing jdbcBatchProcessing=“false”. Which configuration file would this be changed in?

We are facing repeated OptimisticLocking errors that don’t make sense to us. We are not running any async jobs nor parallel processes. But if we submit several process-instance PUTs within a short period of time we will get the error

"Cannot modify variables for process instance 82b56eee-bebf-11e9-8f2a-0242c0a84202: ENGINE-03005 Execution of 'DELETE VariableInstanceEntity[82b59510-bebf-11e9-8f2a-0242c0a84202]' failed. Entity was updated by another transaction concurrently."

We cannot determine what other transaction could be updating this at the same time - we thought a process runs in a single thread. In this case, the variable being updated, orderStatus will trigger a conditional start event within an Event sub-process that will cause the process to end. The bpmn is attached.Scheduling.bpmn (23.3 KB)

@Bill_Powell are you running process application in clustered mode?
Which database are you using? Make sure DB transaction isolation level is READ_COMMITTED.

jdbcBatchProcessing property can be set in the process engine configuration which will be available in file bpm-platform.xml located inside the folder $TOMCAT_HOME/conf.

Thanks. We are not running in clustered mode, it’s a very simple single installation running on an AWS fargate instance. The database is AWS Aurorora/MySql with isolation level READ_COMMITTED.

This problem has been very hard to debug - we feel like we are not doing anything too exotic, simply updating process variables through the REST API.

I modified the bpmn slightly and now I’m getting yet another database error:

Handling exception: {'type': 'RestException', 'message': "Cannot modify variables for process instance 87da7aa6-bed3-11e9-8f2a-0242c0a84202: ENGINE-03004 Exception while executing Database Operation 'DELETE ExecutionEntity[87da7aa6-bed3-11e9-8f2a-0242c0a84202]' with message '\n### Error updating database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot delete or update a parent row: a foreign key constraint fails (`process_engine`.`ACT_RU_VARIABLE`, CONSTRAINT `ACT_FK_VAR_EXE` FOREIGN KEY (`EXECUTION_ID_`) REFERENCES `ACT_RU_EXECUTION` (`ID_`))\n### The error may involve org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.deleteExecution-Inline\n### The error occurred while setting parameters\n### SQL: delete from ACT_RU_EXECUTION where ID_ = ? and REV_ = ?\n### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot delete or update a parent row: a foreign key constraint fails (`process_engine`.`ACT_RU_VARIABLE`, CONSTRAINT `ACT_FK_VAR_EXE` FOREIGN KEY (`EXECUTION_ID_`) REFERENCES `ACT_RU_EXECUTION` (`ID_`))'. Flush summary: \n [\n INSERT HistoricVariableInstanceEntity[98710062-bed3-11e9-8f2a-0242c0a84202]\n INSERT HistoricVariableInstanceEntity[98798bf4-bed3-11e9-8f2a-0242c0a84202]\n INSERT HistoricVariableInstanceEntity[987a9d68-bed3-11e9-8f2a-0242c0a84202]\n INSERT HistoricVariableInstanceEntity[987a9d6a-bed3-11e9-8f2a-0242c0a84202]\n INSERT HistoricVariableInstanceEntity[987a9d6c-bed3-11e9-8f2a-0242c0a84202]\n

This occurs when updating orderStatus to ‘scheduled’, which should end the process.
Scheduling.bpmn (17.7 KB)

I am starting to think there must be something wrong with our database.

How did you setup your camunda database?

Have you created schema manually using scripts provided by camunda?

What version of AWS Aurorora/MySql using?

What’s the camunda version & springboot version & Tomcat version you are using?

The database was created with the Camunda scripts. It was also recently updated to 7.11 and the necessary scripts were run. Our version of Aurora is the latest: 5.7.mysql_aurora.2.03.2.

Camunda is 7.11 using the regular docker distribution, unmodified. We did try disabling jdbcBatchProcessing, but that only changed the error type from a batch error (with a rollback) to a simple single statement error, each claiming data was changed by another transaction.

We are testing a relatively simple workflow, with no traffic whatsoever and seeing these errors whenever this one update occurs. We spent 5 hours this afternoon trying to determine what is the other process that’s updating these orders simultaneously. We are sending in variable updates rapidly, based on a SQL trigger, and one of these updates does cause the process to end due to a conditional start event on an event sub-process. We thought Camunda should be capable of handling frequent variable updates, all coming in through the process-instance/id/variables rest endpoint.

We are open to any database type supported by AWS. We plan to release this into production in two weeks but can’t get past these update failures.

We tried the same workflow with Postgres and are receiving the same errors. We’ve factored in automatic retries but I would still like to understand what is occurring here and why the collisions are occurring. I still don’t see what this ‘other process’ is that would be updating variables concurrently.

@Bill_Powell were you able to resolve the issue stated above. I am also facing a similar issue. My environment setup is as follows

  1. Kubernetes pods with spring boot camunda app
  2. Oracle DB v12.0
  3. heterogeneous cluster setup .

Will appreciate some pointers from you

@megha.gupta5 it has been a long time since this was happening and I don’t recall exactly what we did to resolve this. I believe it involved setting certain activities to be ‘async-before’. It ultimately did not have anything to do with our database type or jdbcbatch settings.