this.upgradingRepository = runInTransaction(new Callable<Boolean>() {
@Override
public Boolean call() throws Exception {
LocalDocumentStore store = documentStore().localStore();
store.prepareDocumentsForUpdate(Collections.unmodifiableSet(REPOSITORY_INFO_KEY));
EditableDocument editor = store.edit(REPOSITORY_INFO_KEY, true);
if (editor.get(REPOSITORY_UPGRADER_FIELD_NAME) == null) {
// Make sure that some other process didn't sneak in and already upgrade ...
int lastUpgradeId = editor.getInteger(REPOSITORY_UPGRADE_ID_FIELD_NAME, 0);
if (upgrades.isUpgradeRequired(lastUpgradeId)) {
// An upgrade is still required, and we get to do it ...