pmList.add(pm);
String[] wspNames = rep.getWorkspaceNames();
Session[] sessions = new Session[wspNames.length];
for (int i = 0; i < wspNames.length; i++) {
String wspName = wspNames[i];
WorkspaceInfo wspInfo = rep.getWorkspaceInfo(wspName);
// this will initialize the workspace if required
SessionImpl session = SystemSession.create(rep, wspInfo.getConfig());
// mark this session as 'active' so the workspace does not get disposed
// by the workspace-janitor until the garbage collector is done
rep.onSessionCreated(session);
// the workspace could be disposed again, so re-initialize if required
// afterwards it will not be disposed because a session is registered
wspInfo.initialize();
sessions[i] = session;
pm = wspInfo.getPersistenceManager();
pmList.add(pm);
}
IterablePersistenceManager[] ipmList = new IterablePersistenceManager[pmList.size()];
for (int i = 0; i < pmList.size(); i++) {
pm = (PersistenceManager) pmList.get(i);