On further testing (and adding additional logs in activiti source to print persistent object state - no other changes),
I found everytime Optimistic locking exception is throw, I see exception message: Unable to instantiate class (JavaDelegate)
Below are logs for one of the MessageEntity (I can provide full logs, if required)
2014-06-12 12:35:11,266 pool-2-thread-3 TestWrapper INFO - TestWrapper called, processInstanceId=849d828b-f24f-11e3-b0ab-081196804620, processDefinitionId=myProcess3:33:840fc167-f24f-11e3-b0ab-081196804620, time variable=8426913569603
2014-06-12 12:35:15,036 Thread-2 org.activiti.engine.impl.jobexecutor.AcquireJobsRunnable WARN - Optimistic locking exception during job acquisition. If you have multiple job executors running against the same database, this exception means that this thread tried to acquire a job, which already was acquired by another job executor acquisition thread.This is expected behavior in a clustered environment. You can ignore this message if you indeed have multiple job executor acquisition threads running against the same database. Exception message: MessageEntity[84a4d5d3-f24f-11e3-b0ab-081196804620], OBJECT STATE: {exceptionMessage=couldn't instantiate class TestWrapper, lockExpirationTime=Thu Jun 12 12:40:14 EDT 2014, lockOwner=d369623d-184a-4465-93a1-05f82183ed79, exceptionByteArrayId=878dc4eb-f24f-11e3-841d-0021283e0734, duedate=null, retries=2} was updated by another transaction concurrently
Exception in thread "pool-2-thread-3" org.activiti.engine.ActivitiOptimisticLockingException: MessageEntity[84a4d5d3-f24f-11e3-b0ab-081196804620], OBJECT STATE: {exceptionMessage=null, lockExpirationTime=Thu Jun 12 12:40:10 EDT 2014, lockOwner=d369623d-184a-4465-93a1-05f82183ed79, duedate=null, retries=3} was updated by another transaction concurrently
—-
Is this error "couldn't instantiate class TestWrapper" — anyway related to optimistic locking exception?
Also why do I see class loading error while this class is definitely called earlier (Logs above - see time stamp)
Thanks