jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tobias Bocanegra (JIRA)" <j...@apache.org>
Subject [jira] Commented: (JCR-134) Unreferenced VersionHistory should be deleted automatically.
Date Mon, 11 Dec 2006 18:47:22 GMT
    [ http://issues.apache.org/jira/browse/JCR-134?page=comments#action_12457436 ] 
            
Tobias Bocanegra commented on JCR-134:
--------------------------------------

>  - should the VH be deleted on node.removeMixin("mix:versionable") ? 
>    would it be safe ?
yes, unless it's not used by another node in another workspace. the only usecase i can think
of is that the application wants to restore the 'versionability' of the node again by adding
the mix:versionable again. it might be desirable if the old versions still exist then.

> - may a Node be versionable in a workspace and not in another one ? I think the
> spec allows it (it doesn't actually forbid it). But I need confirmation.
i think so, too

> So the only way to do this is IMHO the following algorithm :
> - when removing a Version, if this is the last version (only the jcr:rootVersion is
>   left), and there is no references to the jcr:rootVersion, one can remove the VH
yes.

> - when removing a Node, if it is versionable, and references the jcr:rootVersion
>   (ie have never been checked in) and there is no other references to the VH (in
>   others workspaces), then delete the VH
yes.

> - when removing the mix:versionable, either delete directly the VH (see my first
>  question in this post), either check if there is only the jcr:rootVersion left, and

> then delete the VH. 
yes.

in general: after any operation that affects the references to the version storage, check
for orphaned VH and remove them.

the big problem hereby is, that it's not easy or, lets say, not cheap to check if there is
any node that still references the VH. Since there can be a lot of workspaces, which might
be idle. the best would probably be to keep a ref count on the VHs.


> Unreferenced VersionHistory should be deleted automatically.
> ------------------------------------------------------------
>
>                 Key: JCR-134
>                 URL: http://issues.apache.org/jira/browse/JCR-134
>             Project: Jackrabbit
>          Issue Type: New Feature
>          Components: versioning
>            Reporter: Tobias Bocanegra
>         Assigned To: Tobias Bocanegra
>            Priority: Minor
>
> 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.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message