try {
lock.acquire(Lock.WRITE_LOCK);
final VariableByteOutputStream os = new VariableByteOutputStream(8);
doc.write(os);
final Value key = new CollectionStore.DocumentKey(doc.getCollection().getId(), doc.getResourceType(), doc.getDocId());
collectionsDb.put(transaction, key, os.data(), true);
//} catch (ReadOnlyException e) {
//LOG.warn(DATABASE_IS_READ_ONLY);
} catch(final LockException e) {
LOG.warn("Failed to acquire lock on " + collectionsDb.getFile().getName());
} catch(final IOException e) {