Thanks. Here is a cut of my code form the doAddPages method. If I understand correctly, my group object, newGroup, is persisted via the load method. The Page object that is being used in the line throwing the Exception is not. So you're saying I need to persist that page object? There's a method call that generates the collection of Page objects above what I've included. These are generated using session.find. In that method, once I call session.close those page objects are now detached, is that correct?
Karl
Code:
session = HibernateSessionFactory.getSessionFactory().openSession(ConnectionProperties.getConn("iwsdb"));
Group newGroup = (Group)session.load(Group.class, groupNo);
while(it.hasNext()) {
page = (Page) it.next();
if(!tempMod.equals(page.getPageModule())) {
if(counter != 1) {
pages.put(tempMod, pagesInModule);
}
pagesInModule = new ArrayList();
tempMod = page.getPageModule();
}
if(page.isGroupAuthorizedToAccessPage(newGroup)) {
page.setGroupHasAccess(true);
}
pagesInModule.add(page);
counter++;
}