In my application i need to delete all the version data of a node when the node is deleted. I'm getting the version history, I delete the node, then I'm trying to delete all the versions exept the rootVersion node. When I commit the transaction I get a ReferencialIntegrityException because the rootVersion node is referring a deleted node.
What is the solution in this case ?
