jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nicolas " <nto...@gmail.com>
Subject Re: question about save Node
Date Fri, 01 Sep 2006 13:22:42 GMT
Hi,

Try a session.save() please

On 9/1/06, Ducrocq Christophe <Christophe.Ducrocq@atosorigin.com> wrote:
>
> Hi,
>
> I'm a parent which contains more children. I want to save a child who
> cans potentially a new child, without to safeguard all the children
> associated with the parent.
>
> I tested with a method save() on a Item :
>
> Sample:
>         Node parent = root.getNode("hello");
>         Node child_1 = parent.getNode("world");
>         Child_1.setProperty("message","hello world");
>
>
>         Node child_2 = parend.addNode("newNode");
>         child_2.setProperty("message","test");
>
> If I do child_1.save(), I'm a javax.jcr.RepositoryException:
> javax.jcr.RepositoryException: /hello/newNode: cannot save a new item.
>         at
> org.apache.jackrabbit.core.ItemImpl.getTransientStates(ItemImpl.java:335
> )
>         at org.apache.jackrabbit.core.ItemImpl.save(ItemImpl.java:1054)
>         at
> net.atos.wl.fwk.rules.repository.TestJsr.main(TestJsr.java:52)
>
> 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?
>
> Tank you for your responses,
>
> Regards,
>
> Christophe
>
>
>
>
>
>
>


-- 
a+
Nico
my blog! http://www.deviant-abstraction.net !!

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message