You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Stefan Guggisberg (JIRA)" <ji...@apache.org> on 2010/01/20 17:58:54 UTC
[jira] Created: (JCR-2472) Calling Workspace.move() may cause
inconsistent client state
Calling Workspace.move() may cause inconsistent client state
------------------------------------------------------------
Key: JCR-2472
URL: https://issues.apache.org/jira/browse/JCR-2472
Project: Jackrabbit Content Repository
Issue Type: Bug
Components: jackrabbit-jcr2spi
Affects Versions: 2.0-beta6
Reporter: Stefan Guggisberg
the following code fragment causes a PathNotFoundException on an existing path
and there seems to be no way to recover the session from this incorrect state:
// assuming an existing nt:file node at path /apps/foo/bar.txt
Node n1 = session.getNode("/apps/foo/bar.txt");
Node n2 = n1.getNode("jcr:content");
n2.setProperty("jcr:data", new java.io.ByteArrayInputStream(((String)("blahblah")).getBytes()));
n2.save();
Workspace ws0 = session.getWorkspace();
ws0.move("/apps/foo", "/apps/foo1");
Node n3 = session.getNode("/apps/foo1/bar.txt");
Node n4 = n3.getNode("jcr:content");
n4.refresh(false);
Node n5 = n3.getNode("jcr:content"); // => PathNotFoundException
Please note that the preceeding Node.refresh() call seems to cause the inconsistency.
the problem doesn't occur when omitting this call.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (JCR-2472) spi2dav: Accessing moved referenceble
nodes results in PathNotFoundException
Posted by "angela (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-2472?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
angela updated JCR-2472:
------------------------
Summary: spi2dav: Accessing moved referenceble nodes results in PathNotFoundException (was: Calling Workspace.move() may cause inconsistent client state)
the problem occurs both with workspace and with session move and is caused by the uri-lookup that isn't adjusted.
since that part of the spi2dav is marked with TODOs and needs to be reviewed anyway, i will add a simple fix that just
clears the lookup after successful move without making expensive checks if a node having a uniqueID part in the NodeID
was part of the moved tree.
in addition i will add a testcase to jcr2spi (thanks for the code-sniplet)
> spi2dav: Accessing moved referenceble nodes results in PathNotFoundException
> ----------------------------------------------------------------------------
>
> Key: JCR-2472
> URL: https://issues.apache.org/jira/browse/JCR-2472
> Project: Jackrabbit Content Repository
> Issue Type: Bug
> Components: jackrabbit-spi2dav
> Affects Versions: 2.0-beta6
> Reporter: Stefan Guggisberg
>
> the following code fragment causes a PathNotFoundException on an existing path
> and there seems to be no way to recover the session from this incorrect state:
> // assuming an existing nt:file node at path /apps/foo/bar.txt
> Node n1 = session.getNode("/apps/foo/bar.txt");
> Node n2 = n1.getNode("jcr:content");
> n2.setProperty("jcr:data", new java.io.ByteArrayInputStream(((String)("blahblah")).getBytes()));
> n2.save();
> Workspace ws0 = session.getWorkspace();
> ws0.move("/apps/foo", "/apps/foo1");
> Node n3 = session.getNode("/apps/foo1/bar.txt");
> Node n4 = n3.getNode("jcr:content");
> n4.refresh(false);
> Node n5 = n3.getNode("jcr:content"); // => PathNotFoundException
> Please note that the preceeding Node.refresh() call seems to cause the inconsistency.
> the problem doesn't occur when omitting this call.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (JCR-2472) Calling Workspace.move() may cause
inconsistent client state
Posted by "angela (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-2472?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
angela updated JCR-2472:
------------------------
Component/s: (was: jackrabbit-jcr2spi)
jackrabbit-spi2dav
executing the code provided by stefan works if executed in spi2jcr but not with spi2dav(ex).
i therefore assume that this is a problem with workspace-move in spi2dav -> changing component accordingly.
> Calling Workspace.move() may cause inconsistent client state
> ------------------------------------------------------------
>
> Key: JCR-2472
> URL: https://issues.apache.org/jira/browse/JCR-2472
> Project: Jackrabbit Content Repository
> Issue Type: Bug
> Components: jackrabbit-spi2dav
> Affects Versions: 2.0-beta6
> Reporter: Stefan Guggisberg
>
> the following code fragment causes a PathNotFoundException on an existing path
> and there seems to be no way to recover the session from this incorrect state:
> // assuming an existing nt:file node at path /apps/foo/bar.txt
> Node n1 = session.getNode("/apps/foo/bar.txt");
> Node n2 = n1.getNode("jcr:content");
> n2.setProperty("jcr:data", new java.io.ByteArrayInputStream(((String)("blahblah")).getBytes()));
> n2.save();
> Workspace ws0 = session.getWorkspace();
> ws0.move("/apps/foo", "/apps/foo1");
> Node n3 = session.getNode("/apps/foo1/bar.txt");
> Node n4 = n3.getNode("jcr:content");
> n4.refresh(false);
> Node n5 = n3.getNode("jcr:content"); // => PathNotFoundException
> Please note that the preceeding Node.refresh() call seems to cause the inconsistency.
> the problem doesn't occur when omitting this call.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Assigned: (JCR-2472) spi2dav: Accessing moved referenceble
nodes results in PathNotFoundException
Posted by "angela (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-2472?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
angela reassigned JCR-2472:
---------------------------
Assignee: angela
> spi2dav: Accessing moved referenceble nodes results in PathNotFoundException
> ----------------------------------------------------------------------------
>
> Key: JCR-2472
> URL: https://issues.apache.org/jira/browse/JCR-2472
> Project: Jackrabbit Content Repository
> Issue Type: Bug
> Components: jackrabbit-spi2dav
> Affects Versions: 2.0-beta6
> Reporter: Stefan Guggisberg
> Assignee: angela
>
> the following code fragment causes a PathNotFoundException on an existing path
> and there seems to be no way to recover the session from this incorrect state:
> // assuming an existing nt:file node at path /apps/foo/bar.txt
> Node n1 = session.getNode("/apps/foo/bar.txt");
> Node n2 = n1.getNode("jcr:content");
> n2.setProperty("jcr:data", new java.io.ByteArrayInputStream(((String)("blahblah")).getBytes()));
> n2.save();
> Workspace ws0 = session.getWorkspace();
> ws0.move("/apps/foo", "/apps/foo1");
> Node n3 = session.getNode("/apps/foo1/bar.txt");
> Node n4 = n3.getNode("jcr:content");
> n4.refresh(false);
> Node n5 = n3.getNode("jcr:content"); // => PathNotFoundException
> Please note that the preceeding Node.refresh() call seems to cause the inconsistency.
> the problem doesn't occur when omitting this call.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (JCR-2472) spi2dav: Accessing moved referenceble
nodes results in PathNotFoundException
Posted by "angela (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-2472?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
angela resolved JCR-2472.
-------------------------
Resolution: Fixed
Fix Version/s: 2.1.0
> spi2dav: Accessing moved referenceble nodes results in PathNotFoundException
> ----------------------------------------------------------------------------
>
> Key: JCR-2472
> URL: https://issues.apache.org/jira/browse/JCR-2472
> Project: Jackrabbit Content Repository
> Issue Type: Bug
> Components: jackrabbit-spi2dav
> Affects Versions: 2.0-beta6
> Reporter: Stefan Guggisberg
> Assignee: angela
> Fix For: 2.1.0
>
>
> the following code fragment causes a PathNotFoundException on an existing path
> and there seems to be no way to recover the session from this incorrect state:
> // assuming an existing nt:file node at path /apps/foo/bar.txt
> Node n1 = session.getNode("/apps/foo/bar.txt");
> Node n2 = n1.getNode("jcr:content");
> n2.setProperty("jcr:data", new java.io.ByteArrayInputStream(((String)("blahblah")).getBytes()));
> n2.save();
> Workspace ws0 = session.getWorkspace();
> ws0.move("/apps/foo", "/apps/foo1");
> Node n3 = session.getNode("/apps/foo1/bar.txt");
> Node n4 = n3.getNode("jcr:content");
> n4.refresh(false);
> Node n5 = n3.getNode("jcr:content"); // => PathNotFoundException
> Please note that the preceeding Node.refresh() call seems to cause the inconsistency.
> the problem doesn't occur when omitting this call.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.