[ http://issues.apache.org/jira/browse/JCR-466?page=all ]
Tobias Bocanegra reassigned JCR-466: ------------------------------------ Assign To: Tobias Bocanegra (was: Stefan Guggisberg) > Modified values of REFERENCE property not stored correctly > ---------------------------------------------------------- > > Key: JCR-466 > URL: http://issues.apache.org/jira/browse/JCR-466 > Project: Jackrabbit > Type: Bug > Components: core > Reporter: David Garcia > Assignee: Tobias Bocanegra > Attachments: VersionManagerImpl_patch.diff > > Hi, > In a multi-valued property of type REFERENCE, when its values are changed > most of the references are lost upon save(). > I can´t attach a test case, but here is what I´ve been able to test: > 1. REFERENCE property has values [A, B] (A and B being node UUIDs). > 2. A new reference (to node C) is appended to the array of values. New > value should be [A, B, C]. > 3. save(). > 4. Reopen session and reload. > 5. New value is [C]. References to A and B are lost. > I´ve checked that the PersistenceManager gets a NodeReference object with > just one reference to node C, so the bug must be before the store(). > I don´t know the internals of Jackrabbit, but I´ve found a possible source of > the problem in o.a.j.core.version.VersionManagerImpl#setNodeReferences(). > When it "filters out" version storage references it also wipes out previous > references to A and B in the example above. > One thing that has worked for me is to remove the not (!) in the condition: > if (!hasItem(id.getParentId())) { > refs.addReference(id); > } > But now even version storage references are persisted (and this shouldn´t be > happening?). > Anyway, please check whether that solution is OK. > A patch file to change the condition is attached. > Thanks a lot. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira