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

[2.7] OptimisticLockException while using L2 cache fix - backport from master #2250

Merged
merged 1 commit into from
Aug 26, 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 6de65af into eclipse-ee4j:2.7 Aug 26, 2024
6 checks passed
@rfelcman rfelcman deleted the optimisticlock_exception_2.7 branch August 27, 2024 07:29
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