I have a war-application with bpmn process inside. This application has only external tasks and no business logic. It is only for delivery processes to dev or staging servers.
Deploy application means to shut down current docker with tomcat inside and bpmn-war and start a new one with updated processes. All instances (closed and created) work with the same database.
And sometimes during this process, I catch an exception at the process deployment phase inside a new instance of docker
Caused by: org.camunda.bpm.engine.OptimisticLockingException: ENGINE-03005 Execution of 'DELETE TimerEntity[6492c8b3-0d2a-11ea-b4f9-0242ac1e3409]' failed. Entity was updated by another transaction concurrently.
After this exception, the new instance of the application is not working correctly. For example, no one can create a new instance of proces.
My quesion is how to correctly redeploy application or how to correctly shut down canunda application for prevent this exception.
Next restart will fix this issue. But have a nonzero probability that in next redeploy after successful one will fail with the same exception