Skip to content

Invocations of ContentStore methods with PropertyPath argument are not optimistically locked by spring-versions-jpa #1023

@kreymerman

Description

@kreymerman

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions