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.
Under specific conditions is
org.eclipse.persistence.exceptions.OptimisticLockException
incorrectly thrown. Environment conditions are:@Version
annotation is usedTest
org.eclipse.persistence.testing.tests.advanced2.weave.WeaveVersionTest#testWeavedEntitiesWithVersionL2Cache
describe sequence of steps which leads intoorg.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 fromUnitOfWork
scope iforiginal
is still invalid.