entries = dbWords.findKeys(query);
dbWords.removeAll(query);
	public void removeCollection(Collection collection) {		Lock lock = dbWords.getLock();		try {			try {				lock.acquire(this, Lock.WRITE_LOCK);				lock.enter(this);				dbWords.flush();			} catch (LockException e) {				LOG.warn("could not acquire lock on words db", e);				return;			} finally {				lock.release(this);			}			LOG.debug("removing words ...");			WordRef ref = new WordRef(collection.getId());			IndexQuery query = new IndexQuery(null, IndexQuery.TRUNC_RIGHT, ref);			ArrayList entries = null;			try {				lock.acquire(this, Lock.WRITE_LOCK);				lock.enter(this);				entries = dbWords.findKeys(query);			} catch (LockException e) {				LOG.warn("could not acquire lock on words db", e);				entries = null;			} finally {				lock.release(this);			}			if (entries == null) {				LOG.error("could not remove collection");				return;			}			LOG.debug("found " + entries.size() + " words.");			Value val;			for (Iterator i = entries.iterator(); i.hasNext();) {				val = (Value) i.next();				try {					lock.acquire(this, Lock.WRITE_LOCK);					lock.enter(this);					//dbWords.remove(val);					dbWords.remove(val.getAddress());					dbWords.removeValue(val);				} catch (LockException e) {					LOG.warn("could not acquire lock on words db", e);				} finally {					lock.release(this);				}			}			LOG.debug("removed words index");		} catch (BTreeException bte) {			LOG.debug(bte);		} catch (IOException ioe) {			LOG.debug(ioe);		} catch (DBException dbe) {			LOG.warn(dbe);		} catch (ReadOnlyException e) {			LOG.warn("database is read-only");		}	}