document.save();
ridTreePerDocument.put(document.getIdentity(), new ConcurrentSkipListSet<ORID>());
while (true) {
final OClusterPosition position = lastClusterPosition.get();
if (position.compareTo(document.getIdentity().getClusterPosition()) < 0) {
if (lastClusterPosition.compareAndSet(position, document.getIdentity().getClusterPosition()))
break;
} else
break;
}