[ https://issues.apache.org/jira/browse/OAK-1118?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13806617#comment-13806617 ]
angela commented on OAK-1118: ----------------------------- yes... i thought something similar for those cases where the removeMixin plus a subsequent addMixin would include mix:referenceable but i wasn't sure about the past place where to add this... but something like remembering the uuid for those nodes that once had a uuid might improve backwards compatibility... i was even thinking of just keeping an oak-internal identifier-property for those all referenceable nodes which would not be removed if the mixin was gone. what do you think? > Removing and readding mix:versionable fails if node is referenceable > -------------------------------------------------------------------- > > Key: OAK-1118 > URL: https://issues.apache.org/jira/browse/OAK-1118 > Project: Jackrabbit Oak > Issue Type: Bug > Components: core, jcr > Reporter: angela > > removing mix:versionable from a referenceable node will fail with the > following exception: > {quote} > javax.jcr.nodetype.ConstraintViolationException: OakConstraint0022: > /testdata[nt:unstructured, mix:referenceable, mix:versionable]: Mandatory > property jcr:predecessors can not be removed > at > org.apache.jackrabbit.oak.api.CommitFailedException.asRepositoryException(CommitFailedException.java:220) > at > org.apache.jackrabbit.oak.api.CommitFailedException.asRepositoryException(CommitFailedException.java:207) > at > org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.newRepositoryException(SessionDelegate.java:471) > at > org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.save(SessionDelegate.java:334) > at > org.apache.jackrabbit.oak.jcr.session.SessionImpl$8.perform(SessionImpl.java:399) > at > org.apache.jackrabbit.oak.jcr.session.SessionImpl$8.perform(SessionImpl.java:396) > at > org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.perform(SessionDelegate.java:128) > at > org.apache.jackrabbit.oak.jcr.session.SessionImpl.perform(SessionImpl.java:117) > at > org.apache.jackrabbit.oak.jcr.session.SessionImpl.save(SessionImpl.java:396) > at > org.apache.jackrabbit.oak.jcr.nodetype.MixinTest.testRemoveAddMixVersionable2(MixinTest.java:134) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at > org.apache.jackrabbit.test.AbstractJCRTest.run(AbstractJCRTest.java:464) > at > org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83) > at org.junit.runner.JUnitCore.run(JUnitCore.java:157) > at > com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:62) > Caused by: org.apache.jackrabbit.oak.api.CommitFailedException: > OakConstraint0022: /testdata[nt:unstructured, mix:referenceable, > mix:versionable]: Mandatory property jcr:predecessors can not be removed > {quote} > the test: > {code} > @Test > public void testRemoveAddMixVersionable() throws Exception { > testRootNode.addMixin(mixReferenceable); > testRootNode.addMixin(mixVersionable); > superuser.save(); > String vhId = testRootNode.getVersionHistory().getUUID(); > testRootNode.removeMixin(mixVersionable); > testRootNode.addMixin(mixVersionable); > superuser.save(); > assertFalse(vhId.equals(testRootNode.getVersionHistory().getUUID())); > } > {code} > i am not totally sure what is going wrong here as works if the node is only > mix:versionable.... -- This message was sent by Atlassian JIRA (v6.1#6144)