jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tobias Bocanegra" <tobias.bocane...@day.com>
Subject Re: Doubt in Versioning
Date Sat, 08 Dec 2007 15:55:08 GMT
hi,
what you want is 'Node.restore()'.  checkout just makes as checked-in
node modifiable.
in your example the 2nd checkout has no effect since the node is
already checked out.

regards, toby

On 12/8/07, Sridhar Raman <sridhar.raman@gmail.com> wrote:
> This is what I have figured out from reading the documentation, and testing:
> The following code,
> Node A = root.addNode("NODEA", "ATYPE");
>
> A.checkout();
> A.setProperty("PROP1", "some value");
>
> A.save();
> A.checkin();
>
> creates a version for the node A, and currently the node is in a read-only
> status.
>
> Now if I were to execute the following code,
> Node A = root.getNode("NODEA");
>
> A.checkout();
> A.setProperty("PROP1", "some other different value");
>
> A.save();
> // NOT DOING ANY CHECK-IN
>
> I expected no new version to be created for node A.  And yes, this happens
> as expected.
> But say, I execute this code now,
> Node A = root.getNode("NODEA");
>
> A.checkout();
> System.out.println(A.getProperty("PROP1").getString());
>
> I expected the value "some value" to be printed.  This was because, I
> thought the checkout that I do would mean that I get node A's latest
> version.  But what is printed is "some other different value".
>
> I somehow found this a bit counter-intuitive.  Can someone please clarify my
> doubt?
>
> Thanks,
> Sridhar
>


-- 
-----------------------------------------< tobias.bocanegra@day.com >---
Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH - 4001 Basel
T +41 61 226 98 98, F +41 61 226 98 97
-----------------------------------------------< http://www.day.com >---

Mime
View raw message