You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Konrad Windszus (Jira)" <ji...@apache.org> on 2022/01/20 08:13:00 UTC

[jira] [Assigned] (OAK-9436) Session.getImportContentHandler() adds new nodes/properties to transient space despite ConstraintViolationException

     [ https://issues.apache.org/jira/browse/OAK-9436?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Konrad Windszus reassigned OAK-9436:
------------------------------------

    Assignee:     (was: Konrad Windszus)

> Session.getImportContentHandler() adds new nodes/properties 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
>            Priority: Major
>
> 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.
> The same happens for properties which are not valid according to the node type definition.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)