Value key = new Value(CollectionStore.FREE_DOC_ID_KEY);
Value key = new CollectionStore.CollectionKey(CollectionStore.FREE_DOC_ID_KEY);
	public int getFreeResourceId(Txn transaction) throws ReadOnlyException {		int freeDocId = DocumentImpl.UNKNOWN_DOCUMENT_ID;				Lock lock = collectionsDb.getLock();		try {			lock.acquire(Lock.WRITE_LOCK);            Value key = new Value(CollectionStore.FREE_DOC_ID_KEY);			Value value = collectionsDb.get(key);			if (value != null) {				byte[] data = value.getData();				freeDocId = ByteConversion.byteToInt(data, data.length - 4);//				LOG.debug("reusing document id: " + freeDocId);				if(data.length - 4 > 0) {					byte[] ndata = new byte[data.length - 4];					System.arraycopy(data, 0, ndata, 0, ndata.length);					collectionsDb.put(transaction, key, ndata, true);				} else					collectionsDb.remove(transaction, key);			}            //TODO : maybe something ? -pb		} catch (LockException e) {			LOG.warn("Failed to acquire lock on " + collectionsDb.getFile().getName(), e);			return DocumentImpl.UNKNOWN_DOCUMENT_ID;            //TODO : rethrow ? -pb		} finally {			lock.release();		}		return freeDocId;	}