jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Garcia (JIRA)" <j...@apache.org>
Subject [jira] Commented: (JCR-466) Modified values of REFERENCE property not stored correctly
Date Tue, 20 Jun 2006 13:47:30 GMT
    [ http://issues.apache.org/jira/browse/JCR-466?page=comments#action_12416900 ] 

David Garcia commented on JCR-466:
----------------------------------

Hi,

I´ve been doing some testing and debugging and here´s what I can tell you so far:
- "Real" deployment environment is Model 2 (Shared) with a custom FileSystem and PersistenceManager.
- "Test" deployment environment is a standalone command line application with LocalFileSystem
and XMLPersistenceManager.
- The bug has only been reproduced in "Real". In "Test" everything works fine.
- I´m positive the bug has nothing to do with using a custom FileSystem and PersistenceManager.
- Both the "nt:resource" node and the referring node have "mix:versionable" mixin type.

When I create the "nt:resource" node, add a reference to it and call save(), the PersistenceManager´s
store() method is called three times:
1. Store the "nt:resource" node.
2. Store the modified reference property.
3. Store de modified references.
Between steps 2 and 3, "virtual node references" are filtered out at line 542 in SharedItemStateManager.
And here´s the difference between both environments. In "Real", virtualProviders[i].hasItemState(id)
is true and virtual = true. In "Test", virtualProviders[i].hasItemState(id) is false.
Does this help?

If you need anything else, feel free to ask :-)
Thanks.

> 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


Mime
View raw message