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 "Tobias Bocanegra (JIRA)" <ji...@apache.org> on 2017/01/11 11:33:58 UTC

[jira] [Comment Edited] (OAK-5229) Using Node.setPrimaryType() should fail if non-matching childnodes

    [ https://issues.apache.org/jira/browse/OAK-5229?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15818068#comment-15818068 ] 

Tobias Bocanegra edited comment on OAK-5229 at 1/11/17 11:33 AM:
-----------------------------------------------------------------

The problem is, that you can change the nodetype in such a way, that the repository will be broken in that subtree. If you import packages via vault, you can end up in this state. I think there is a possibility that this can happen.

Is it really so hard to verify this? the logic already exists when altering mixin types.

I set it to critical, because you can render the repository unusable with a simple {{setPrimaryType()}} call.


was (Author: tripod):
The problem is, that you can change the nodetype in such a way, that the repository will be broken in that subtree. If you import packages via vault, you can end up in this state. I think there is a possibility that this can happen.

Is it really so hard to verify this? the logic already exists when altering mixin types.

I set it to critical, because you can render the repository unusable with a simple {{setNodeType()}} call.

> Using Node.setPrimaryType() should fail if non-matching childnodes
> ------------------------------------------------------------------
>
>                 Key: OAK-5229
>                 URL: https://issues.apache.org/jira/browse/OAK-5229
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.5.14
>            Reporter: Tobias Bocanegra
>            Assignee: Thomas Mueller
>            Priority: Critical
>             Fix For: 1.5.18
>
>
> 1. Assume the following:
> {noformat}
> /testNode [nt:unstructured]
>   /unstructured_child [nt:unstructured]
> {noformat}
> 2. setting "/testNode".setPrimaryType("nt:folder")
> 3. save the session.
> Altering the primary type works, thus leaving the repository in an inconsistent state.
> Interestingly, subsequent calls to "/testNiode/unstructured_child".setProperty() will fail:
> {noformat}
> javax.jcr.nodetype.ConstraintViolationException: OakConstraint0001: /test_node[[nt:folder]]: No matching definition found for child node unstructured_child with effective type [nt:unstructured]
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)