When you first create a versionable node, and set properties on it you don't have to check it in, session.save is all you need.

From then on, if you want to make changes follow this pattern

node.checkout();
node.setProperty(......);
.....
....
node.save();
node.checkin();
session.save();

//create versionable node
         Node n = parentNode.addNode("childNode", "nt:unstructured");
         n.addMixin("mix:versionable");
         n.setProperty("anyProperty", "Blah");
         session.save();
         Version firstVersion = n.checkin();



----- Original Message ----- From: "Katia Santos" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Wednesday, April 02, 2008 4:52 AM
Subject: Re: checkin problem


Hello,

I still have checkin problems, even with jackrabbit 1.4.2.

I´m doing the example in the wiki page:

//create versionable node
         Node n = parentNode.addNode("childNode", "nt:unstructured");
         n.addMixin("mix:versionable");
         n.setProperty("anyProperty", "Blah");
         session.save();
         Version firstVersion = n.checkin();

In the last line, when it does the checkin it sends an exception:
javax.jcr.RepositoryException: /Outros/Documento[13]: unable to
update item.: 068f02ca-c562-4c31-b8ff-2e091a985932:
068f02ca-c562-4c31-b8ff-2e091a985932

This is the example on the jackrabbit wiki. Is it wrong?? Can someone
explain to me why it doesnt work? I really tried everything...always sends
an exception. Helppp pleeesee :)


Katia

Reply via email to