[ https://issues.apache.org/jira/browse/OAK-8048?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16806165#comment-16806165 ]
Marco Piovesana commented on OAK-8048: -------------------------------------- Hi all, I would like to propose a solution for this bug (attached patch). I saw that the class responsible for checking whether or not to remove the history is the {{OrphanedVersionCleaner}}, but I thought that was better to add the logic directly into {{ReadWriteVersionManager}} for three reasons: # All the logic used within the {{leave}} method works for nodes and not versions # The {{OrphanedVersionCleaner.leave}} method is called much more often than the {{ReadWriteVersionManager.removeVersion}}, that is called only when a version is removed # The class {{ReadWriteVersionManager}} contains already all the logic to check if the history is empty and remove it let me know if the proposed solution if ok, or what can I do to make it better. thanks, Marco.[^fix-OAK-8048.patch] > VersionHistory not removed when removing node and all its versions > ------------------------------------------------------------------ > > Key: OAK-8048 > URL: https://issues.apache.org/jira/browse/OAK-8048 > Project: Jackrabbit Oak > Issue Type: Bug > Components: core > Affects Versions: 1.8.9 > Reporter: Marco Piovesana > Priority: Major > Attachments: fix-OAK-8048.patch > > > Hi all, > I'm trying to delete a node and all its versions, but the version history is > not removed. I'm doing the following steps (as described in OAK-4370 and > JCR-34): > # retrieve the version history > # delete the node and save the session > # delete all versions except for the base version > # save the session > The versions are all gone but the versionHistory node, and the base version > node, are still there. Am I doing something wrong? > The only test related to this that I found is > {{ReadOnlyVersionManagerTest.testRemoveEmptyHistoryAfterRemovingVersionable}}. > It does work, but uses Oak related classes and not the JCR interface. -- This message was sent by Atlassian JIRA (v7.6.3#76005)