Jackrabbit Content Repository
  1. Jackrabbit Content Repository
  2. JCR-2661

Two JCR unit tests expect delete events for nodes under deleted node, contrary to JCR 2.0 specification

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.1
    • Fix Version/s: None
    • Labels:
      None

      Description

      There are two JCR unit tests (part of the TCK unit test suite) that are deleting a subgraph and expecting the JCR implementation to produce NODE_REMOVED events for all nodes in the subgraph:

      org.apache.jackrabbit.test.api.observation.NodeRemovedTest.testMultiNodesRemoved() line 70
      org.apache.jackrabbit.test.api.observation.WorkspaceOperationTest.testCopy() line 54

      While this was required in the JCR 1.0 specification, the JCR 2.0 specification allows for different behavior. From Section 12.2 of the JCR 2.0 specification:

      "The scope of event reporting is implementation-dependent. An implementation should make a best-effort attempt to
      report all events, but may exclude events if reporting them would be impractical given implementation or resource
      limitations. For example, on an import, move or remove of a subgraph containing a large number of items, an
      implementation may choose to report only events associated with the root node of the affected graph and not those
      for every subitem in the structure."
      http://www.day.com/specs/jcr/2.0/12_Observation.html#ScopeofEventReporting

      In some implementations, producing NODE_REMOVED events for every node in the deleted subgraph require first reading this information from persistent storage to identify all of the nodes that are being removed. While this is often acceptable for small operations, doing this for even moderately-sized subgraphs can induce an unnecessary performance penalty on the remove operation.

      Therefore, the JCR unit tests (i.e., the TCK tests) should not expect or require an implementation produce NODE_REMOVED events for all nodes in the subgraph, but per the specification should merely expect at least a single NODE_REMOVED event for the top node in the subgraph.

        Activity

        Hide
        Randall Hauch added a comment -

        Removed the 'jackrabbit-core' component, as it is unrelated to this issue and was added by mistake.

        Show
        Randall Hauch added a comment - Removed the 'jackrabbit-core' component, as it is unrelated to this issue and was added by mistake.

          People

          • Assignee:
            Unassigned
            Reporter:
            Randall Hauch
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:

              Development