jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Florent Guillaume ...@nuxeo.com>
Subject observing event ordering
Date Mon, 26 Jun 2006 14:07:09 GMT

It seems that JSR-170 doesn't specify any ordering of the events  
returned by the EventIterator.
Can I assume more ordering from the Jackrabbit implementation?

For instance, if there's addChild() of /foo then a remove() of it,  
can I be sure I'll see NODE_REMOVED before NODE_ADDED?

If there's addChild(), remove(), addChild(), remove() of the same  
path, will I see two removes and two adds (it doesn't seem so)?

If a node is removed, will I observe a NODE_REMOVED of its children  
before itself?

I'm asking because it's not clear, for example in a test run I get:
2: event NODE_REMOVED     path /blob/under
2: event NODE_REMOVED     path /blob
2: event PROPERTY_ADDED   path /blob/under/jcr:primaryType
2: event PROPERTY_ADDED   path /blob/youpi
2: event NODE_ADDED       path /blob/under
2: event PROPERTY_ADDED   path /blob/jcr:primaryType
2: event NODE_ADDED       path /blob
This is for code that does (this is jython code btw):
         // /blob and /blob/under were added before
         node = root.getNode('blob')
         blob = root.addNode('blob', 'nt:unstructured')
         blob.setProperty('youpi', 'true',  
         node = blob.addNode('under', 'nt:unstructured')
You see that for instance I get an ADD of /blob/under before the ADD  
of /blob, and an ADD of /blob/under/jcr:primaryType before /blob/ 
under itself, which is counter-intuitive. Should I assume anything?

If I'm right nothing is specified, I think JSR-283 will have to  
clarify this a bit.


Florent Guillaume, Nuxeo (Paris, France)   Director of R&D
+33 1 40 33 71 59   http://nuxeo.com   fg@nuxeo.com

View raw message