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

Alex Parvulescu commented on OAK-5229:
--------------------------------------

Coming back to the idea that oak needs to fail as early as possible.
There is a suggestion in the comments that mixins are somehow validated eagerly 
[0]. I can't find examples of this, all the tests I see are based on 
session.save calls. I would love to have a pointer to the code that validates 
node type integrity directly whenever mixins are changed (and not via a 
commithook).
Then you have compatibility with Jackrabbit problem which I'm not fully 
convinced is a very strong argument considering the Oak version we are at now 
(4 maintenance branches alive and well). Has anyone ran into this eager 
validation issue until now?

I'm very inclined to not touch the current validation strategy (based on 
commithooks) and apply the patch to fix this issue, and take up the eager 
validation for discussion on the mailing list as that is in my view a broader 
change that merits its own issue and discussion.

[~anchela], [~tripod] thoughts?


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

> 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: Alex Parvulescu
>            Priority: Critical
>             Fix For: 1.8, 1.6.1
>
>         Attachments: OAK-5229.patch, OAK-5229-tests.patch, OAK-5229-v2.patch
>
>
> 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.15#6346)

Reply via email to