title: Can't remove version in Jackrabbit
body: <p>I'm trying to remove a version from the version history and I'm getting javax.jcr.ReferentialIntegrityException: Unable to remove version. At least once referenced.</p>
  
  <p>When I try to remove all references to the version it seems like there aren't any and still does not allow me to remove the version.
  I am sure that this is not the root version and I'm also sure its not the first after the root.</p>
  
  <p>This is my code:</p>
  
  <pre><code>    Version ver = manager.checkin(parentNodePath);
  
      VersionHistory versionHistory = manager.getVersionHistory(parentNodePath);
      PropertyIterator versionReverences = ver.getReferences();
      for (Property verRef = versionReverences.nextProperty(); versionReverences.hasNext();) {
          verRef.remove();
      }
      session.save();
      versionHistory.removeVersion(ver.getName());
  </code></pre>
  
  <p>Any help is greatly appreciated, thanks.</p>