jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tobias Bocanegra <tobias.bocane...@day.com>
Subject Re: Bug in JR transactions when using mix:versionnable nodes? (XASession)
Date Fri, 23 Sep 2005 12:00:17 GMT
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 <marcin.cenkier@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 >---

Mime
View raw message