catch (RepositoryException e)
{
// OK - wc1 Version History contain nt:versionedChild with link to non exist Version history
// remove bugy version history
SessionDataManager dataManager = session.getTransientNodesManager();
NodeImpl vhPicture =
(NodeImpl)session.getItem("/jcr:system/jcr:versionStorage/" + versionHistory
+ "/1/jcr:frozenNode/medias/picture");
assertTrue(vhPicture.isNodeType("nt:versionedChild"));
PlainChangesLog changesLogDelete = new PlainChangesLogImpl();
changesLogDelete.add(ItemState.createDeletedState(((PropertyImpl)vhPicture
.getProperty("jcr:childVersionHistory")).getData()));
changesLogDelete.add(ItemState.createDeletedState(((PropertyImpl)vhPicture.getProperty("jcr:primaryType"))
.getData()));
changesLogDelete.add(ItemState.createDeletedState((vhPicture.getData())));
picture = wc1.getNode("medias").getNode("picture");
changesLogDelete.add(ItemState.createDeletedState(((PropertyImpl)picture.getProperty("jcr:mixinTypes"))
.getData()));
dataManager.getTransactManager().save(changesLogDelete);
}
}