}
}
final boolean removeKey(final Object key, final Object[] oldVal) {
DataCursor cursor = null;
boolean doAutoCommit = beginAutoCommit();
try {
cursor = new DataCursor(view, true);
boolean found = false;
int err = cursor.get(key, null, Db.DB_SET, true);
while (err == 0) {
cursor.delete();
found = true;
if (oldVal != null && oldVal[0] == null)
oldVal[0] = cursor.getCurrentValue();
err = cursor.get(null, null, Db.DB_NEXT_DUP, true);
}
closeCursor(cursor);
commitAutoCommit(doAutoCommit);
return found;
} catch (Exception e) {