I'm not suggesting anything, but that's how transactional databases work. If you get two connections from different places that modifies the same row in the database one will success and the other will fail. The expcetion is clear about that:
javax.persistence.OptimisticLockException
It's not a jbpm5 problem, its how databases work. If you not ensure that two thread can keep everything consistent one needs to fail.
In which scenario are you getting that exception? what are you trying to achieve?
Best regards