broker = factory.getBrokerPool().get(user);
try {
collection = broker.openCollection(collUri, Lock.READ_LOCK);
if (collection == null) {
transact.abort(transaction);
throw new EXistException("collection " + collUri + " not found!");
}
} finally {
if (collection != null)
{collection.release(Lock.READ_LOCK);}
}
final CollectionConfigurationManager mgr = factory.getBrokerPool().getConfigurationManager();
mgr.addConfiguration(transaction, broker, collection, configuration);
transact.commit(transaction);
LOG.info("Configured '" + collection.getURI() + "'");
} catch (final CollectionConfigurationException e) {
transact.abort(transaction);
throw new EXistException(e.getMessage());
} finally {
transact.close(transaction);
factory.getBrokerPool().release(broker);
}
return false;