[ https://issues.apache.org/jira/browse/OAK-5229?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15894673#comment-15894673 ]
Alex Parvulescu commented on OAK-5229: -------------------------------------- Attaching patch post OAK-5887. this is now only about the purge behavior changes. I'm not fully convinced that backwards compatibility is a real issue here, I have yet to see any code that calls into this, except the vlt installer. To offer a transition period I've introduced a system property that would disable the new behavior, so one can set {{oak.nodetype.purgeNodeOnTypeChange}} to {{true}} to maintain pre-oak-1.8 (or jackrabbit) like semantics. The immediate fallout of applying this patch is that vlt code will break, as already noted on this issue. I don't currently have any plans of investigating these failures. [~tripod] let me know if you need any help in this area. [~tripod] as you were the only one left with concerns about this change, does this seem like a reasonable way forward? > 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 > > Attachments: OAK-5229.patch, OAK-5229-tests.patch, OAK-5229-v2.patch, > OAK-5229-v3.patch, OAK-5229-v4.patch, OAK-5229-v5.patch, OAK-5229-v6.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)