Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 367132

Summary: Refreshing Query with No Identity Map causes update
Product: z_Archived Reporter: Gordon Yorke <gordon.yorke>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P2 CC: eclipselink.foundation-inbox
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
proposed Patch
none
Small update to previous patch none

Description Gordon Yorke CLA 2011-12-19 15:50:47 EST
Created attachment 208585 [details]
proposed Patch

If an Entity is configured with No Identity Map ("eclipselink.cache.type=none") and a refresh query is executed on that Entity within a Persistence Context when the transaction commits an update will occur incrementing the version value even though the Entity has no changes.

This issue is cause because without a cache the Revert API can not be used so mergeClone is used instead.  Merge code, however, tracks changes and even though those changes are reverting the Entity to the latest state they are tracked as new changes.

The solution is to update the refreshing code to use mergeClone to always refresh and make mergeClone aware of when it is being refreshed.
Comment 1 Gordon Yorke CLA 2011-12-20 10:09:25 EST
Patched code committed
Reviewed by Tom Ware
Comment 2 Gordon Yorke CLA 2011-12-22 14:48:31 EST
Created attachment 208748 [details]
Small update to previous patch
Comment 3 Gordon Yorke CLA 2011-12-22 14:48:54 EST
Patch code committed
Comment 4 Eclipse Webmaster CLA 2022-06-09 10:17:14 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink
Comment 5 Eclipse Webmaster CLA 2022-06-09 10:26:57 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink