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

Bug 358261

Summary: Cache Coordination fails to keep OneToMany with order column updated when using CacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES
Product: z_Archived Reporter: Tom Ware <tom.ware>
Component: EclipselinkAssignee: Tom Ware <tom.ware>
Status: CLOSED 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 fix none

Description Tom Ware CLA 2011-09-20 11:27:14 EDT
Take a simple example with

Folder - 1-Many -> File

When cache coordination type is set to SEND_NEW_OBJECTS_WITH_CHANGES, the follow scenario will fail to update the remote caches with the File property

1. Create an folder with a file on server 1
2. read it in both servers (to put it in the cache)
3. delete both the folder and the file on server 1
4. create a new folder with a file on server 1
5. read it on server 2

In this case, the server 2 version of the Folder does not contain any files

The reason for this issue is that our merge code makes use of the addObjectList which is not serialized.  As a result, when we try to merge into the cache, the addObject list contains no elements and the Folder is created with no files.

We should use the orderedAddObjectIndices list instead -> like the remove code uses.
Comment 1 Tom Ware CLA 2011-09-20 15:30:36 EDT
Created attachment 203707 [details]
proposed fix
Comment 2 Tom Ware CLA 2011-09-20 15:33:19 EDT
Final change was to allow the orderedAddObjectList to be serialized.  There is very little cost to this because other variables containing the same change sets are already serialized.
Comment 3 Tom Ware CLA 2011-09-20 16:15:20 EDT
Fix checked into trunk, 2.1, 2.2 and 2.3 to follow

Review Chris Delahunt - pending

Added test to RCM Distributed Model

Tested with JPA and Core LRG
Comment 4 Tom Ware CLA 2011-09-21 09:19:30 EDT
Fix checked into 2.3.x, 2.2.x and 2.1.x
Comment 5 Eclipse Webmaster CLA 2022-06-09 10:04:20 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink