try
{
//empty the cache before clearing
m_Index.emptyPageCache();
final BTreeIterator iter = new BTreeIterator(m_Index);
Object key;
KeyObject[] keyArray = new KeyObject[1];
while(iter.isValid()) {
key = iter.getKey();
if (key != null) {
//This key should not be wrapped in a JipsKey because it comes from the iterator.
keyArray[0] = (KeyObject) key;
m_Database.remove( keyArray );
}
if (!iter.moveNext()){
break;
}
}
}
catch (Exception ignore)