for (String workspaceName : repositorty.getWorkspaceNames())
{
WorkspaceContainerFacade wc = repositorty.getWorkspaceContainer(workspaceName);
SessionRegistry sessionRegistry = (SessionRegistry)wc.getComponent(SessionRegistry.class);
sessionRegistry.closeSessions(workspaceName);
}
// remove repository from configuration
repositoryService.removeRepository(repositoryName);
repositoryService.getConfig().retain();