You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Alexander Nesterov <al...@gmail.com> on 2007/09/17 16:39:37 UTC
A question about versioning when OnParentVersion=VERSION
Hi,
I don't fully understand how versioning works for nodes that have
OnParentVersion attributes set to "VERSION". I have a versionable
parent node with a child node versioned by it's own. When a new
version of parent node is created it has a subnode representing the
child node. The problem is that the child node has only
jcr:childVersionHistory property which is a reference to it's version
history but not a references to any particular version. Why the
reference to version history but not to the particular version of
child node is created? Without information about particular version
it's impossible to revert parent and child nodes in future to the
exact current state. Maybe i don't understand the design of versioning
in JCR?
TIA,
--
Alexander Nesterov
Re: A question about versioning when OnParentVersion=VERSION
Posted by Alexander Nesterov <al...@gmail.com>.
Hi Peeter,
On 9/17/07, Peeter Piegaze <pe...@day.com> wrote:
> Hi Alexander,
>
> Yes, this is the intended behavior. A subnode with OPV=VERSION is
> meant to be an independently versionable item, not closely bound to
> the parent node. What you probably want to do is make your subnode
> OPV=COPY. This means that the subnode will be copied as part of the
> frozen state of the parent node, then when the parent node is restored
> the subnode is restored with it.
>
Yep, if OnParentVersion=COPY then it will be possible to restore the
subnode, but it's not very suitable in my case. The problem is that in
current implementation of Jackrabbit COPY operation is quite resource
consuming for large binary data. In my situation parent node
represents a wiki page that is versionable and child nodes represent
files attached to this page. Each file has it's own version history
too. I don't want to copy all attachments each time when page text
changes. All I want is to store a reference to the particular version
of attachments. Is there a way to implement such behavior using
standard versioning or maybe there are some other known patterns?
--
Alexander Nesterov
Re: A question about versioning when OnParentVersion=VERSION
Posted by Peeter Piegaze <pe...@day.com>.
Hi Alexander,
Yes, this is the intended behavior. A subnode with OPV=VERSION is
meant to be an independently versionable item, not closely bound to
the parent node. What you probably want to do is make your subnode
OPV=COPY. This means that the subnode will be copied as part of the
frozen state of the parent node, then when the parent node is restored
the subnode is restored with it.
Cheers,
Peeter
On 9/17/07, Alexander Nesterov <al...@gmail.com> wrote:
> Hi,
>
> I don't fully understand how versioning works for nodes that have
> OnParentVersion attributes set to "VERSION". I have a versionable
> parent node with a child node versioned by it's own. When a new
> version of parent node is created it has a subnode representing the
> child node. The problem is that the child node has only
> jcr:childVersionHistory property which is a reference to it's version
> history but not a references to any particular version. Why the
> reference to version history but not to the particular version of
> child node is created? Without information about particular version
> it's impossible to revert parent and child nodes in future to the
> exact current state. Maybe i don't understand the design of versioning
> in JCR?
>
> TIA,
> --
> Alexander Nesterov
>
--
Peeter Piegaze
Day Software
Suite 331
67 Mowat Avenue
Toronto Ontario M6K 3E3
Canada
office +1 416 987 5720
mobile +1 647 205 2403
fax +1 866 719 3988