why ActivitiOptimisticLockException is thrown after serviceTask is completed, not before its execution? During stress tests I can see, that executor which get AOLE done given serviceTask and after that exception is thrown, so task will be executed again?
Why lock is not checked before serviceTask execution? And another question - how I can handle such case to avoid such situations?
Optimistic locking on itself is not a problem. If you have multiple executors, it is even expected, as multiple executors are battling for the same jobs. Nothing to worry about.. (see other thread where I replied too)