Because OptimisticLockingInterceptor
checks only a certain list methods (without PropertyPath argument), invocations of ContentStore methods with PropertyPath argument are not optimistically locked.
In addition, I would like to take this opportunity to ask whether it is necessary to call EntityManager::merge in the OptimisticLockingInterceptor::lock method.
This can sometimes have unexpected consequences: I wanted to automatically remove the associated content in s3 storage, but only after the entity has been successfully removed from the database. But if I call Content::unsetContent with an Entity that has already been removed from the database, merge causes it to be recreated.
Sorry for asking this question here, I didn't make a separate issue for this because this is a very specific and probably unsupported case and there is a workaround for it (using ((DeletableResource)contentStore.getResource(...)).delete()), but maybe merge isn't really needed here and can be removed?