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

                 Key: JCR-2661
                 URL: https://issues.apache.org/jira/browse/JCR-2661
             Project: Jackrabbit Content Repository
          Issue Type: Bug
          Components: jackrabbit-core, jackrabbit-jcr-tests, JCR 2.0
    Affects Versions: 2.1.0
            Reporter: Randall Hauch


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.

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

Reply via email to