I am trying to remove the latest version and getting exception thrown.
Code is:
VersionHistory vh = fileNode.getVersionHistory();
VersionIterator vi = vh.getAllVersions();
while(vi.hasNext())
latestVersion = vi.nextVersion();
vh.removeVersion(latestVersion.getName());
Exception is:
javax.jcr.ReferentialIntegrityException: Unable to remove version. At least
once referenced.
Any clues?
Thanks,
Mohinder
-----Original Message-----
From: Alexander Klimetschek [mailto:[email protected]]
Sent: Friday, October 09, 2009 2:50 AM
To: [email protected]
Subject: Re: Aborting Checkout
On Thu, Oct 8, 2009 at 20:40, Mohinder Singh <[email protected]> wrote:
> If I checkout() a node, then its non-versionable tree becomes
write-enabled.
> How do I abort (don't want to make changes) this checkout() so that nodes
> tree is read-only again.
> I do not want to create another version by checkin().
I'd say don't change anything (session.refresh()), checkin() and
delete the unnecessary version.
Regards,
Alex
--
Alexander Klimetschek
[email protected]