When two process engines starts in a cluster in parallel, a ProcessEngineException can occur while trying to commit the history level configuration to the database.
There is no Locking mechanism while setting the history level and this causes the concurrent issue.
- both process engines start successfully
- acquire pessimistic lock before inserting the history level
- perform automatic retry when history level insertion fails with optimistic locking exception or primary key constraint violation