/*
* truncate clones the existing database and returns a new one to
* replace it with. The old databaseImpl object is marked
* 'deleted'.
*/
TruncateResult result =
envHandle.getEnvironmentImpl().truncate(locker, databaseImpl);
databaseImpl = result.getDatabase();
operationOk = true;
return countRecords ? result.getRecordCount() : -1;
} finally {
/*
* The txn will know if it's living past the end of this operation,
* and if it needs to transfer the handle lock. operationEnd()