jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ducrocq Christophe" <Christophe.Ducr...@atosorigin.com>
Subject question about save Node
Date Fri, 01 Sep 2006 12:30:11 GMT
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






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