log.info(debugHeader() + "Remove " + key);
}
checkFiler(FaultCodes.COL_NO_FILER);
Key objKey = createNewKey(key);
objKey = getIdentityKey(objKey);
synchronized (objKey) {
Object oldDoc = getEntry(objKey);
if (oldDoc != null && oldDoc instanceof Document) {
indexManager.removeDocument(objKey, (Document)oldDoc);
}
if (documentCache != null) {
documentCache.removeDocument(this, objKey);
}
if (!filer.deleteRecord(objKey)) {
throw new DBException(FaultCodes.COL_DOCUMENT_NOT_FOUND,
"Resource '" + objKey + "' does not exist in '" + getCanonicalName() + "'");
}
// update the meta for this collection if necessary
updateCollectionMeta();
// remove the document meta
if (isMetaEnabled()) {
getMetaSystemCollection().dropDocumentMeta(this, objKey.toString());
}
}
DBObserver.getInstance().dropDocument(this, objKey);
}