You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "angela (JIRA)" <ji...@apache.org> on 2012/09/26 14:29:07 UTC

[jira] [Updated] (OAK-343) Session.getNodeByUUID requires save call

     [ https://issues.apache.org/jira/browse/OAK-343?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

angela updated OAK-343:
-----------------------

    Description: 
while adding mix:referenceable to a new node immediately assigns a 
uuid and makes the node referenceable, session.getNodeByUUID only works
after saving the changes.

the following test illustrates this behavior:

@Test
public void getNodeByUUID() throws RepositoryException {
   Node node = getNode("/foo").addNode("boo");
   node.addMixin(JcrConstants.MIX_REFERENCEABLE);

   assertTrue(node.isNodeType(JcrConstants.MIX_REFERENCEABLE));
   String uuid = node.getUUID();
   assertNotNull(uuid);
   assertEquals(uuid, node.getIdentifier());

   Node nAgain = node.getSession().getNodeByUUID(uuid);
   assertTrue(nAgain.isSame(node));
   assertTrue(nAgain.isSame(node.getSession().getNodeByIdentifier(uuid)));
}

  was:
while adding mix:referenceable to a new node immediately assigns a 
uuid and makes the node referenceable, session.getNodeByUUID only works
after saving the changes.

the following test illustrates this behavior:

@Test
    public void getNodeByUUID() throws RepositoryException {
        Node node = getNode("/foo").addNode("boo");
        node.addMixin(JcrConstants.MIX_REFERENCEABLE);

        assertTrue(node.isNodeType(JcrConstants.MIX_REFERENCEABLE));
        String uuid = node.getUUID();
        assertNotNull(uuid);
        assertEquals(uuid, node.getIdentifier());

        Node nAgain = node.getSession().getNodeByUUID(uuid);
        assertTrue(nAgain.isSame(node));
          assertTrue(nAgain.isSame(node.getSession().getNodeByIdentifier(uuid)));
    }

    
> Session.getNodeByUUID requires save call
> ----------------------------------------
>
>                 Key: OAK-343
>                 URL: https://issues.apache.org/jira/browse/OAK-343
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: core, jcr
>            Reporter: angela
>
> while adding mix:referenceable to a new node immediately assigns a 
> uuid and makes the node referenceable, session.getNodeByUUID only works
> after saving the changes.
> the following test illustrates this behavior:
> @Test
> public void getNodeByUUID() throws RepositoryException {
>    Node node = getNode("/foo").addNode("boo");
>    node.addMixin(JcrConstants.MIX_REFERENCEABLE);
>    assertTrue(node.isNodeType(JcrConstants.MIX_REFERENCEABLE));
>    String uuid = node.getUUID();
>    assertNotNull(uuid);
>    assertEquals(uuid, node.getIdentifier());
>    Node nAgain = node.getSession().getNodeByUUID(uuid);
>    assertTrue(nAgain.isSame(node));
>    assertTrue(nAgain.isSame(node.getSession().getNodeByIdentifier(uuid)));
> }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira