You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by Marcin Cenkier <ma...@cognifide.com> on 2005/09/22 16:05:57 UTC
Bug in JR transactions when using mix:versionnable nodes? (XASession)
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
Re: Bug in JR transactions when using mix:versionnable nodes? (XASession)
Posted by Tobias Bocanegra <to...@day.com>.
hi marcin,
the problem is, that versioning operations currently do not
participate in the transactions. i will take a look into it. it would
be cool, if you could file a jira bug.
cheers, tobi
On 9/22/05, Marcin Cenkier <ma...@cognifide.com> wrote:
> 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
>
>
-----------------------------------------< tobias.bocanegra@day.com >---
Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH - 4001 Basel
T +41 61 226 98 98, F +41 61 226 98 97
-----------------------------------------------< http://www.day.com >---