On 2010-03-03 14:51, Jukka Zitting [via Jackrabbit] wrote:
Hi,

On Wed, Mar 3, 2010 at 11:24 AM, Nils Weinander
<[hidden email]
<http://n4.nabble.com/user/SendEmail.jtp?type=node&node=1576552&i=0>>
wrote:
 >   Node containerNode = rootNode.addNode(id,
jcrConstants.getNT_FOLDER());
 >   containerNode.addMixin("mix:title");
 >   containerNode.setProperty("jcr:title", title);
 >   containerNode.setProperty("jcr:description", description);
 >   session.save();

Try replacing the last line with:

rootNode.getSession().save();

As discussed, you're probably saving the wrong session.

No, that doesn't make a difference and shouldn't really as
I have got rootNode from session:

Node rootNode = session.getRootNode();                          
Node containerNode = rootNode.addNode(id, jcrConstants.getNT_FOLDER());
containerNode.addMixin("mix:title");
containerNode.setProperty("jcr:title", title);
containerNode.setProperty("jcr:description", description);
session.save();

I am trying to upgrade spring-modules-jcr to a newer version,
but have other problems with that so far.


PS. See constants like NodeType.NT_FOLDER, NodeType.MIX_TITLE and
Property.JCR_DESCRIPTION in JCR 2.0.

Nice!

--
mogul | nils weinander |
hudiksvallsgatan 4 113 30 stockholm sweden |
+46 8 4100 6456 | +46 709 78 28 37 |
[email protected] | skype: nils.weinander |
www.mogul.com

Reply via email to