jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcin Cenkier <marcin.cenk...@cognifide.com>
Subject Bug in JR transactions when using mix:versionnable nodes? (XASession)
Date Thu, 22 Sep 2005 14:05:57 GMT
Hi,
I have big problems with mix:versionable nodes when using XASession for
transactions. When I run the code outside transactions - everything goes
ok. But when i run it inside transaction, it fails:

Node parentNode = session.getRootNode();

try {
     parentNode.getNode(PARENT_NODE_NAME);
}
catch (Exception e) {
     Node node = parentNode.addNode(PARENT_NODE_NAME);
     node.addMixin("mix:versionable");
     parentNode.save();
}

Node versionableParent = session.getRootNode().getNode(PARENT_NODE_NAME);

log.info("versionableParent.isCheckedOut()" +
versionableParent.isCheckedOut());

versionableParent.checkout();

Node node = versionableParent.addNode("NODE");

node.addMixin("mix:versionable");

log.info("created node [" + node.getName() + "]");
versionableParent.save();

node.checkin();                            <== (*)

versionableParent.checkin();

log.info("node.isCheckedOut()" + node.isCheckedOut());

Here's the stacktrace:

15:41:14,434 ERROR (TransactionalItemStateManager.java:114) -
java.lang.Exception: Cannot commit transaction.
[...]
Caused by: org.apache.jackrabbit.core.state.TransactionException: Unable
to commit transaction.:
31f78b39-6422-4ec8-b41e-2571b6807b05/{http://www.jcp.org/jcr/1.0}isCheckedOut
[...]
Caused by: org.apache.jackrabbit.core.state.NoSuchItemStateException:
31f78b39-6422-4ec8-b41e-2571b6807b05/{http://www.jcp.org/jcr/1.0}isCheckedOut
[...]

When I removed (*) line, transaction commits, but the node is left
checked out...

Any ideas?

PS.
I can send you a sample code that shows the problem if you want.

-- 
Best Regards,                              Senior developer at Cognifide

Marcin Cenkier                                         www.cognifide.com


Mime
View raw message