jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tobias Bocanegra" <tobias.bocane...@day.com>
Subject Re: Problem with child order after restoring of parent
Date Thu, 22 Jun 2006 15:05:02 GMT
this might be a bug. can you file a jira issue?

thanks.

regards, toby

On 6/22/06, Tanju Erinmez <tanju.erinmez@gmail.com> wrote:
> Greetings,
>
> I'm using the latest trunk version and tried the following sequence
> which leads to swapped child nodes (this worked in 1.0.1).
> Specifically:
>
> Add nodes:
>   parent
>     childA
>     childB
>
> Remove childA:
>   parent
>     childB
>
> Restore initial version:
>   parent
>     childB
>     childA
>
> The parent node is of type nt:unstructured which carries an
> OrderableChildNodes=true so I assumed that upon restoring the order
> would be preserved.
>
> What would be the correct behavior for this?
>
> Cheers,
> Tanju
>
> --------------
>
> TESTCASE used with both Derby & InMemPMs (boiled down beyond sense :)
>
> // Add parent & childA, childB
> Node parent = session.getRootNode().addNode("parent", "nt:unstructured");
> parent.addMixin("mix:versionable");
> Node c1 = parent.addNode("childA", "nt:unstructured");
> c1.addMixin("mix:versionable");
> Node c2 = parent.addNode("childB", "nt:unstructured");
> c2.addMixin("mix:versionable");
> session.save();
> c1.checkin();
> c2.checkin();
> Version v1 = parent.checkin();
> // OK : parent.getNodes() -> childA, childB
>
> // Remove childA
> parent = session.getRootNode().getNode("parent");
> parent.checkout();
> c1 = parent.getNodes().nextNode();
> c1.checkout();
> c1.remove();
> session.save();
> Version v2 = parent.checkin();
> // OK : parent.getNodes() -> childA, childB
>
> // Remove childA
> parent = session.getRootNode().getNode("parent");
> parent.restore(v1, true);
> // Not OK : parent.getNodes() -> childB, childA
>


-- 
-----------------------------------------< tobias.bocanegra@day.com >---
Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH - 4001 Basel
T +41 61 226 98 98, F +41 61 226 98 97
-----------------------------------------------< http://www.day.com >---

Mime
View raw message