Konrad Windszus created OAK-9436:
------------------------------------

             Summary: Session.getImportContentHandler() adds new node to 
transient space despite ConstraintViolationException 
                 Key: OAK-9436
                 URL: https://issues.apache.org/jira/browse/OAK-9436
             Project: Jackrabbit Oak
          Issue Type: Bug
          Components: jcr
    Affects Versions: 1.38.0
            Reporter: Konrad Windszus


When Session.getImportContentHandler tries to add a new child node which is not 
allowed due to the parent node's node type definition a {{SAXException}} is 
thrown wrapping a {{ConstraintViolationException}}. Still the new node has 
already been added to the transient space of that session as with 
`Session.save()` the exact same exception is thrown again.

{code}
 javax.jcr.nodetype.ConstraintViolationException: No matching node definition 
found for new     at 
org.apache.jackrabbit.oak.plugins.nodetype.EffectiveNodeTypeImpl.getNodeDefinition(EffectiveNodeTypeImpl.java:461)
        at 
org.apache.jackrabbit.oak.plugins.nodetype.ReadOnlyNodeTypeManager.getDefinition(ReadOnlyNodeTypeManager.java:396)
        at 
org.apache.jackrabbit.oak.jcr.xml.ImporterImpl.getDefinition(ImporterImpl.java:547)
        at 
org.apache.jackrabbit.oak.jcr.xml.ImporterImpl.endNode(ImporterImpl.java:482)
        at 
org.apache.jackrabbit.oak.jcr.xml.SysViewImportHandler.processNode(SysViewImportHandler.java:89)
{code}

Jackrabbit 2 throws the {{ConstrantViolationException}} as well but won't add 
the new (invalid) node to the transient space.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to