[ 
https://issues.apache.org/jira/browse/JCR-134?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sébastien Launay updated JCR-134:
---------------------------------

    Attachment: jackrabbit-1.4.x-JCR-134-first-try-2008-08-11.patch

As no one reply to my thread for fixing this issue:
http://markmail.org/message/7boajk2b2mnhe4xf
i will try to submit a fix :).

The solution that i propose is based on the following facts:
- if there is no references to the VersionHistory node then no one node is 
alive.
- if the VersionHistory node has only two children (root version and version 
labels) then there is no version for restoring the content.

These tests are computed in InternalVersionHistoryImpl#removeVersion(Name).

The following use cases are supported:
- committed node.remove() followed by multiple versionHistory.removeVersion(..)
the version history is then deleted in the same time as the last version is 
removed.

The following use cases are not supported (yet):
- node.removeMixin("mix:versionable")
- node.remove() after all versions (except the root version) have been deleted 
(don't know if this is possible)

This patch comes with a test case to validate version history cleaning.

I will be waiting for your feedbacks.

> Unreferenced VersionHistory should be deleted automatically.
> ------------------------------------------------------------
>
>                 Key: JCR-134
>                 URL: https://issues.apache.org/jira/browse/JCR-134
>             Project: Jackrabbit
>          Issue Type: New Feature
>          Components: versioning
>            Reporter: Tobias Bocanegra
>            Assignee: Tobias Bocanegra
>            Priority: Minor
>         Attachments: jackrabbit-1.4.x-JCR-134-first-try-2008-08-11.patch
>
>
> since the creation of a VersionHistory is triggered by the creation of a 
> mix:versionable node, the removal should happen automatically, as soon as no 
> references to that version histroy exist anymore. this is the case, when all 
> mix:versionable nodes (in all workspaces) belonging to that VH are deleted, 
> and all the versions in the VH are removed i.e. only the jcr:rootVersion is 
> left. At this point, the VH should be deleted aswell.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to