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

Bug 196870

Summary: [repo] Consistency on write for LocalMetadataRepository
Product: [Eclipse Project] Equinox Reporter: Pascal Rapicault <pascal>
Component: p2Assignee: P2 Inbox <equinox.p2-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: simon_kaegi
Version: 3.4   
Target Milestone: 3.5   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Pascal Rapicault CLA 2007-07-17 15:57:46 EDT
I ended up in a situation where I had multiple instances of LocalMetadataRepository backed by the same file on disk. Therefore when content was being added through one repo, the other would not see it, thus causing problem on save since the save persists the whole content of the repo.

There are several ways to solve this:
- keep track of the timestamps and do the appropriate thing on load/save. What would happen on get?
- assume that this never happens because for a given repo we should only have one and only one object in the system (see bug #196869)
- make sure we can append to the file 
We could make sure that We could either decide
Comment 1 Jeff McAffer CLA 2007-07-17 22:22:29 EDT
just to point out that we have several file utilities around that should help us with this case.  FileManager, chunky streams, ...
Comment 2 John Arthorne CLA 2008-09-08 21:56:34 EDT
It shouldn't be possible to get into this state of having multiple instances. This was perhaps caused by bug 196869, or bug 241289 is a more recent example. I think making sure this can't happen is the best solution, since it's unclear how we would handle merge semantics here.

*** This bug has been marked as a duplicate of bug 241289 ***