We are experiencing ActivitOptimisticexception two cases on single server.
1. When we try to delete a running job. Please suggest how to carefully wait before calling runTimeService.deleteProcessInstance(String processInstanceId, String deleteReason).
2. We have customised AcquiredJobCommand, that in execute method we set its lock owner, lock expiration time and retries and then add the job to AcquiredJobs. What among these be a reason for this exception? Please suggest.