-
Bug
-
Resolution: Done
-
Blocker
-
3.1.3.Final
-
None
Given the following CND file:
<jcr='http://www.jcp.org/jcr/1.0'> <nt='http://www.jcp.org/jcr/nt/1.0'> <inf='http://www.example.com/test'> [inf:patient] > mix:versionable, nt:hierarchyNode + * (inf:patientId) COPY + * (inf:section) SNS COPY - inf:masterId (STRING) mandatory COPY - inf:masterNs (STRING) mandatory COPY /** * A section node is a named container of either episodes or documents. */ [inf:section] > nt:hierarchyNode orderable - inf:name (STRING) mandatory COPY + * (nt:hierarchyNode) SNS VERSION [inf:patientId] - inf:name (STRING) mandatory COPY
the following algorithm should be allowed, but ModeShape incorrectly throws an exception:
- create an inf:patient node (with any mandatory properties)
- create one or more inf:section nodes (with any mandatory properties)
- save
- create another inf:section node (with any mandatory properties)
The last step causes the following exception:
javax.jcr.ItemExistsException: A node definition that allows same name siblings could not be found for the node "{}section" in workspace "default" at org.modeshape.jcr.JcrSession$JcrPreSave.processAfterLocking(JcrSession.java:1914) at org.modeshape.jcr.cache.document.WritableSessionCache.runPreSaveAfterLocking(WritableSessionCache.java:479) at org.modeshape.jcr.cache.document.WritableSessionCache.save(WritableSessionCache.java:540) at org.modeshape.jcr.JcrSession.save(JcrSession.java:986) at ...
Note that the "inf:patient" node definition must have two residual child node definitions (one of type "inf:patientId" and the other of "inf:section") in order for this test to fail. If the "inf:patientId" child node definition is removed, then it works fine.