Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-9436

Session.getImportContentHandler() adds new nodes/properties to transient space despite ConstraintViolationException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.38.0
    • None
    • jcr
    • None

    Description

      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.

       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)
      

      Jackrabbit 2 throws the ConstrantViolationException as well but won't add the new (invalid) node to the transient space.
      The same happens for properties which are not valid according to the node type definition.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              kwin Konrad Windszus
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: