jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Waschkowski (JIRA)" <j...@apache.org>
Subject [jira] Created: (JCR-991) Queries 'see' added nodes within repository before being persisted, not allowed according to spec (6.6.12)
Date Thu, 28 Jun 2007 13:59:26 GMT
Queries 'see' added nodes within repository before being persisted, not allowed according to
spec (6.6.12)
----------------------------------------------------------------------------------------------------------

                 Key: JCR-991
                 URL: https://issues.apache.org/jira/browse/JCR-991
             Project: Jackrabbit
          Issue Type: Bug
          Components: query
    Affects Versions: 1.3
            Reporter: Mark Waschkowski
            Priority: Minor


I believe the last assertion should hold true since session.save() has not been called. 

ie. (as far as I understand from 6.6.12 of the spec) a query should NOT see added nodes in
the query results, as search is against persistent state.

  public void testSession() throws RepositoryException{
    String parentNodeName = "documents";
    Node parentNode = session.getRootNode().addNode(parentNodeName);
    
    String nodeName = "contact";
    Node node = session.getRootNode().getNode(parentNodeName).addNode(nodeName);
    node.setProperty("firstName", "joe");
    
    Node contactNode = session.getRootNode().getNode(parentNodeName + "/" + nodeName);
    assertNotNull(contactNode);
    
    String xpath = parentNodeName;
    NodeIterator ni = session.getRootNode().getNode(xpath).getNodes();
    System.out.println("ni count =" + ni.getSize());
    String name1 = ni.nextNode().getName().toString();
    System.out.println("Found node using getNode(xpath):" + name1);
    
    //session.save();
    Workspace ws = session.getWorkspace();
    QueryManager qm = ws.getQueryManager();
    Query q = qm.createQuery(xpath, Query.XPATH);
    NodeIterator iter = q.execute().getNodes();
    while(iter.hasNext()){
      Node queryNode = iter.nextNode();
      System.out.println("Found node using Query:" + queryNode.getName());
    }
    
    System.out.println("iter size=" + iter.getSize());
    assertEquals(0, iter.getSize());
  }

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


Mime
View raw message