jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jukka Zitting" <jukka.zitt...@gmail.com>
Subject Re: question about save Node
Date Fri, 01 Sep 2006 13:39:47 GMT
Hi,

On 9/1/06, Nicolas <ntoper@gmail.com> wrote:
> Try a session.save() please

It's the equivalent to a save() on the parent node in this case.
Something that Christophe doesn't want to do.

> On 9/1/06, Ducrocq Christophe <Christophe.Ducrocq@atosorigin.com> wrote:
> > But, I do parent.save(), I save all children of parent. (What does not
> > interest me)
> >
> > On which node has to call upon the method save() ?
> > How then I to make to solve my problems?

One solution that was discussed earlier was to have a separate
"staging" node where you create and save the new node, and then use
Workspace.move() it to the correct location. Workspace.move() is
immediately persisted without a need to call save(), so it avoids your
problem.

On a related note, I think it might make sense to implement a feature
in Jackrabbit that allows you to do the following:

    Node parent = Session.getRootNode().getNode(...);
    Node child = parent.addNode(...);
    child.save();

Feel free to file a Jira feature request for that if you like. Patches
are also welcome (warning: requires diving deep into Jackrabbit
internals).

BR,

Jukka Zitting

-- 
Yukatan - http://yukatan.fi/ - info@yukatan.fi
Software craftsmanship, JCR consulting, and Java development

Mime
View raw message