Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[master] OptimisticLockException while using L2 cache fix #2248

Merged
merged 1 commit into from
Aug 23, 2024

Conversation

rfelcman
Copy link
Contributor

Under specific conditions is org.eclipse.persistence.exceptions.OptimisticLockException incorrectly thrown.
Environment conditions are:

  • JPA L2 cache enabled
  • Weaving is applied to used entities
  • @Version annotation is used

Test org.eclipse.persistence.testing.tests.advanced2.weave.WeaveVersionTest#testWeavedEntitiesWithVersionL2Cache describe sequence of steps which leads into org.eclipse.persistence.exceptions.OptimisticLockException if fix is not applied.

Purpose of fix in org.eclipse.persistence.internal.sessions.UnitOfWorkImpl#cloneAndRegisterObject(java.lang.Object, org.eclipse.persistence.internal.identitymaps.CacheKey, org.eclipse.persistence.internal.identitymaps.CacheKey, org.eclipse.persistence.descriptors.ClassDescriptor) is update current working object with non-invalidated version from UnitOfWork scope if original is still invalid.

@rfelcman rfelcman merged commit c4fc6f1 into eclipse-ee4j:master Aug 23, 2024
6 checks passed
rfelcman added a commit to rfelcman/eclipselink that referenced this pull request Aug 26, 2024
Under specific conditions is org.eclipse.persistence.exceptions.OptimisticLockException incorrectly thrown.
Environment conditions are:

    JPA L2 cache enabled
    Weaving is applied to used entities
    @Version annotation is used

Test org.eclipse.persistence.testing.tests.advanced2.weave.WeaveVersionTest#testWeavedEntitiesWithVersionL2Cache describe sequence of steps which leads into org.eclipse.persistence.exceptions.OptimisticLockException if fix is not applied.

Purpose of fix in org.eclipse.persistence.internal.sessions.UnitOfWorkImpl#cloneAndRegisterObject(java.lang.Object, org.eclipse.persistence.internal.identitymaps.CacheKey, org.eclipse.persistence.internal.identitymaps.CacheKey, org.eclipse.persistence.descriptors.ClassDescriptor) is update current working object with non-invalidated version from UnitOfWork scope if original is still invalid.

Signed-off-by: Radek Felcman <[email protected]>
(cherry picked from commit c4fc6f1)
rfelcman added a commit to rfelcman/eclipselink that referenced this pull request Aug 26, 2024
Under specific conditions is org.eclipse.persistence.exceptions.OptimisticLockException incorrectly thrown.
Environment conditions are:

    JPA L2 cache enabled
    Weaving is applied to used entities
    @Version annotation is used

Test org.eclipse.persistence.testing.tests.advanced2.weave.WeaveVersionTest#testWeavedEntitiesWithVersionL2Cache describe sequence of steps which leads into org.eclipse.persistence.exceptions.OptimisticLockException if fix is not applied.

Purpose of fix in org.eclipse.persistence.internal.sessions.UnitOfWorkImpl#cloneAndRegisterObject(java.lang.Object, org.eclipse.persistence.internal.identitymaps.CacheKey, org.eclipse.persistence.internal.identitymaps.CacheKey, org.eclipse.persistence.descriptors.ClassDescriptor) is update current working object with non-invalidated version from UnitOfWork scope if original is still invalid.

Signed-off-by: Radek Felcman <[email protected]>
(cherry picked from commit c4fc6f1)
rfelcman added a commit that referenced this pull request Aug 26, 2024
Under specific conditions is org.eclipse.persistence.exceptions.OptimisticLockException incorrectly thrown.
Environment conditions are:

    JPA L2 cache enabled
    Weaving is applied to used entities
    @Version annotation is used

Test org.eclipse.persistence.testing.tests.advanced2.weave.WeaveVersionTest#testWeavedEntitiesWithVersionL2Cache describe sequence of steps which leads into org.eclipse.persistence.exceptions.OptimisticLockException if fix is not applied.

Purpose of fix in org.eclipse.persistence.internal.sessions.UnitOfWorkImpl#cloneAndRegisterObject(java.lang.Object, org.eclipse.persistence.internal.identitymaps.CacheKey, org.eclipse.persistence.internal.identitymaps.CacheKey, org.eclipse.persistence.descriptors.ClassDescriptor) is update current working object with non-invalidated version from UnitOfWork scope if original is still invalid.

Signed-off-by: Radek Felcman <[email protected]>
(cherry picked from commit c4fc6f1)
rfelcman added a commit that referenced this pull request Aug 26, 2024
Under specific conditions is org.eclipse.persistence.exceptions.OptimisticLockException incorrectly thrown.
Environment conditions are:

    JPA L2 cache enabled
    Weaving is applied to used entities
    @Version annotation is used

Test org.eclipse.persistence.testing.tests.advanced2.weave.WeaveVersionTest#testWeavedEntitiesWithVersionL2Cache describe sequence of steps which leads into org.eclipse.persistence.exceptions.OptimisticLockException if fix is not applied.

Purpose of fix in org.eclipse.persistence.internal.sessions.UnitOfWorkImpl#cloneAndRegisterObject(java.lang.Object, org.eclipse.persistence.internal.identitymaps.CacheKey, org.eclipse.persistence.internal.identitymaps.CacheKey, org.eclipse.persistence.descriptors.ClassDescriptor) is update current working object with non-invalidated version from UnitOfWork scope if original is still invalid.

Signed-off-by: Radek Felcman <[email protected]>
(cherry picked from commit c4fc6f1)
@rfelcman rfelcman deleted the optimisticlock_exception branch August 27, 2024 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants