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

JCR Observation fires events in another workspace

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 2.0.0.Final
    • 1.2.0.Final
    • JCR
    • None
    • Low

      According the JCR API (jsr170 and jsr283) Observation feature it is notification of persistent changes to a workspace.
      But two different listeners registered onto sessions of two different workspaces receive changes of a whole Repository.
      Seems, it's due to the concept of Graph API adopted to JCR API, Graph assumes whole Repository observation.
      Targeted Workspace can be taken in account with the check added to org.modeshape.jcr.JcrObservationManager#notify(Changes):

      List<ChangeRequest> requests = changes.getChangeRequests();
      if (requests.size() == 0 || !session.getWorkspace().getName().equals(requests.get(0).changedWorkspace())) {
      // return if nothing to observe or this is not the targeted workspace
      return;
      }

      This check assumes the change request list to one Workspace only. If it's not true it will not works properly.

        1. config-repository.xml
          2 kB
        2. JcrObservationManager.patch
          0.8 kB
        3. MODE-782-fix.patch
          11 kB
        4. TestJCRObservation.java
          6 kB

            rhauch Randall Hauch (Inactive)
            pnedonosko Peter Nedonosko (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: