directory.mkdir();
server = new NetworkServerControl();
startDerby();
RepositoryConf conf = new RepositoryConf();
// set jdbc urls on PMs for external derby
// workspaces
PersistenceManagerConf pmc = conf.getWorkspaceConfTemplate().getPersistenceManagerConf();
pmc.setParameter("url", "jdbc:derby://localhost/${wsp.home}/version/db/itemState;create=true");
pmc.setParameter("driver", DRIVER);
pmc.setParameter("user", USER);
pmc.setParameter("password", PASSWORD);
// false is the default value anyway, but we want to make sure, the code does not block forever
pmc.setParameter("blockOnConnectionLoss", "false");
// versioning
pmc = conf.getVersioningConf().getPersistenceManagerConf();
pmc.setParameter("url", "jdbc:derby://localhost/${rep.home}/db/itemState;create=true");
pmc.setParameter("driver", DRIVER);
pmc.setParameter("user", USER);
pmc.setParameter("password", PASSWORD);
// false is the default value anyway, but we want to make sure, the code does not block forever
pmc.setParameter("blockOnConnectionLoss", "false");
RepositoryConfig config = conf.createConfig(directory.getPath());
config.init();
repository = RepositoryImpl.create(config);
}