EntityUpdateAction increments version despite veto on update
Description
The EntityUpdateAction requests whether the update is vetoed by calling preUpdate(). Even if the returned value is true (the update shall NOT be executed), the nextVersion is set to the actual entity. Only executing the update itself is skipped, which inevitably leads to an OptimisticLockingException when the entity is flushed.
The corresponding code is
where nextVersion is the value that the @Version annotated property previously had plus one. Either the nextVersion should be the same as the previous value or the entry.postUpdate(...) must not be executed if veto is true.
The EntityUpdateAction requests whether the update is vetoed by calling preUpdate(). Even if the returned value is true (the update shall NOT be executed), the nextVersion is set to the actual entity. Only executing the update itself is skipped, which inevitably leads to an OptimisticLockingException when the entity is flushed.
The corresponding code is
where nextVersion is the value that the @Version annotated property previously had plus one. Either the nextVersion should be the same as the previous value or the entry.postUpdate(...) must not be executed if veto is true.