You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "angela (JIRA)" <ji...@apache.org> on 2007/08/07 14:49:59 UTC

[jira] Commented: (JCR-1040) JCR2SPI: remove node operation missing in submitted SPI batch

    [ https://issues.apache.org/jira/browse/JCR-1040?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12518150 ] 

angela commented on JCR-1040:
-----------------------------

hi julian

i tried to reproduce the problem you describe but i don't get neither get a wrong ChangeLog nor a wrong Batch. What i did:

- starting from both the root-node and the configured testRootNode
- adding a nt:folder node ("a") and save changes
- then remove the node previously created , adding new node with same name/nt and 
  an additional child node ("b", "nt:folder").
- and saving all changes.

=> the removed node-state has status EXISTING_REMOVED until the save is completed.
=> ChangeLog contains 3 Operations: 1x Remove, 2x AddNode and all affected states.
=> all Operations are executed on the Batch.

similarly the example with the move seemed to work for me.
am i missing something?

my questions to you:
- were you able to reproduce the problem with the setup from the checkout (jcr2spi - spi2jcr)?
- what revision were you using? (mine: 563477) 




> JCR2SPI: remove node operation missing in submitted SPI batch
> -------------------------------------------------------------
>
>                 Key: JCR-1040
>                 URL: https://issues.apache.org/jira/browse/JCR-1040
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: SPI
>            Reporter: Julian Reschke
>
> In JCR2SPI, the following sequence of operations seems to lead to an incorrect SPI batch being submitted:
> 1) remove "/a"
> 2) add "/a"
> 3) add "/a/b"
> 4) session.save()
> This seems to create an SPI batch where the first remove operation is missing.
> Note that the problem only seems to occur when step 3 is part of the sequence.
> Full Java source for test:
>     try {
>       if (session.getRepository().getDescriptor(Repository.LEVEL_2_SUPPORTED).equals("true")) {
>         Node testnode;
>         String name = "delete-test";
>           
>         Node root = session.getRootNode();
>         
>         // make sure it's there
>         if (! root.hasNode(name)) {
>           root.addNode(name, "nt:folder");
>           session.save();
>         }
>         
>         // now test remove/add in one batch
>         if (root.hasNode(name)) {
>           testnode = root.getNode(name);
>           testnode.remove();
>           // session.save(); // un-commenting this makes the test pass
>         }
>         
>         testnode = root.addNode(name, "nt:folder");
>         // add one child
>         testnode.addNode(name, "nt:folder"); // commenting this out makes the test pass
>         
>         session.save();
>       }
>     } finally {
>       session.logout();
>     }
>     
>     

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.