Uploaded image for project: 'ModeShape'
  1. ModeShape
  2. MODE-1940

move of node from /a/b to /a/c does not update query index

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Blocker
    • 3.3.0.Final
    • 3.2.0.Final
    • JCR
    • None
    • Hide

      Note that this is happening in an application in EAP 6.1 using UserTransaction.begin() and commit() to bracket session.login() and save()/logout().

      // Create nodes.
      Session session = repository.login();
      Node a = session.getRootNode().addNode("a");
      a.addNode("c");
      session.save();
      session.logout();
      
      // Rename /a/c to /a/d
      session = repository.login();
      session.getWorkspace().move("/a/c", "/a/d");
      session.save();
      session.logout();
      
      // This query returns no nodes which is incorrect.
      Query query = session.getWorkspace().getQueryManager().createQuery("select n from [nt:unstructured] as n where localname(n) = 'd'", Query.JCR_SQL2);
      
      // This query returns the node, but node.getPath() = '/a/d' and
      // node.getName() = 'd' which is incorrect.
      query = session.getWorkspace().getQueryManager().createQuery("select n from [nt:unstructured] as n where localname(n) = 'c'", Query.JCR_SQL2);
      
      
      Show
      Note that this is happening in an application in EAP 6.1 using UserTransaction.begin() and commit() to bracket session.login() and save()/logout(). // Create nodes. Session session = repository.login(); Node a = session.getRootNode().addNode("a"); a.addNode("c"); session.save(); session.logout(); // Rename /a/c to /a/d session = repository.login(); session.getWorkspace().move("/a/c", "/a/d"); session.save(); session.logout(); // This query returns no nodes which is incorrect. Query query = session.getWorkspace().getQueryManager().createQuery("select n from [nt:unstructured] as n where localname(n) = 'd'", Query.JCR_SQL2); // This query returns the node, but node.getPath() = '/a/d' and // node.getName() = 'd' which is incorrect. query = session.getWorkspace().getQueryManager().createQuery("select n from [nt:unstructured] as n where localname(n) = 'c'", Query.JCR_SQL2);

    Description

      Create node /a/b, then move to /a/c. Performing a SQL2 query for a node where localname = 'c' returns no results. Perform a query where localname = 'b' returns the node, but node.getName() is 'c'.

      Attachments

        Issue Links

          Activity

            People

              hchiorean Horia Chiorean (Inactive)
              jonathandfields_jira Jonathan Fields (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: