Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-343

Session.getNodeByUUID requires save call

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.7
    • Component/s: core, jcr
    • Labels:
      None

      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)));
      }

        Attachments

        1. OAK-343-v2.patch
          17 kB
          Alex Deparvu
        2. oak-343-QueryIndex.patch
          11 kB
          Manfred Baedke

          Activity

            People

            • Assignee:
              tmueller Thomas Mueller
              Reporter:
              anchela angela
            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: