* @throws PersistitException
     *             if there are any internal errors
     * @throws IllegalArgumentException
     *             if key1 is equal to or greater than key2
     */
    public boolean removeKeyRange(Key key1, Key key2) throws PersistitException {
        key1.copyTo(_spareKey3);
        key2.copyTo(_spareKey4);

        // Special case for empty key
        if (key1.getEncodedSize() == 0) {
            _spareKey3.append(BEFORE);
        }

        if (key2.getEncodedSize() == 0) {
            _spareKey4.append(AFTER);
        }

        if (_spareKey3.compareTo(_spareKey4) >= 0) {
            throw new IllegalArgumentException("Second key must be greater than the first");
        }

        final boolean result = removeKeyRangeInternal(_spareKey3, _spareKey4, false);
        _treeHolder.verifyReleased();
        return result;
    }