Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 358261 - Cache Coordination fails to keep OneToMany with order column updated when using CacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES
Summary: Cache Coordination fails to keep OneToMany with order column updated when usi...
Status: CLOSED 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: Tom Ware CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-20 11:27 EDT by Tom Ware CLA
Modified: 2022-06-09 10:04 EDT (History)
1 user (show)

See Also:


Attachments
proposed fix (7.53 KB, patch)
2011-09-20 15:30 EDT, Tom Ware CLA
no flags Details | Diff

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