Please also check MariaDB.
CAM-8306 INSERT/UPDATE failure due to optimistic locking situation does not throw OptimisticLockingException
CAM-8798 Add a Uniqueness constraint test case for INSERT/UPDATE failure due to optimistic locking situation does not throw OptimisticLockingException