h2/src/main/org/h2/mvstore/MVMap.java
/**
     * Rollback to the given version.
     *
     * @param version the version
     */
Rollback to the given version.
@param version the version
Rollback to the given version . @param version the version
void rollbackTo(long version) {
        beforeWrite();
        try {
            removeUnusedOldVersions();
            if (version <= createVersion) {
            } else if (root.getVersion() >= version) {
                ArrayList<Page> list = oldRoots;
                while (list.size() > 0) {
                    int i = list.size() - 1;
                    Page p = list.get(i);
                    root = p;
                    list.remove(i);
                    if (p.getVersion() < version) {
                        break;
                    }
                }
            }
        } finally {
            afterWrite();
        }
    }
void rollbackTo ( long version ) { beforeWrite ( ) ; try { removeUnusedOldVersions ( ) ; if ( version <= createVersion ) { } else if ( root . getVersion ( ) >= version ) { ArrayList < Page > list = oldRoots ; while ( list . size ( ) > 0 ) { int i = list . size ( ) - 1 ; Page p = list . get ( i ) ; root = p ; list . remove ( i ) ; if ( p . getVersion ( ) < version ) { break ; } } } } finally { afterWrite ( ) ; } }
Rollback to the given version.
Rollback to the given version .
// the map is removed later // iterating in descending order - // this is not terribly efficient if there are many versions