Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 367132 - Refreshing Query with No Identity Map causes update
Summary: Refreshing Query with No Identity Map causes update
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-19 15:50 EST by Gordon Yorke CLA
Modified: 2022-06-09 10:26 EDT (History)
1 user (show)

See Also:


Attachments
proposed Patch (26.14 KB, patch)
2011-12-19 15:50 EST, Gordon Yorke CLA
no flags Details | Diff
Small update to previous patch (6.17 KB, patch)
2011-12-22 14:48 EST, Gordon Yorke CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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