OK, I have now rebuilt and redployed this app using the latest CVS snapshot of Hibernate2 (using the v21branch tag) and am still getting this error. But I am getting much more logging, so thats good.
I think I've discovered the cause of the issue, but cannot figure out why it would be an issue. As part of my Inteceptor chain on flushing dirty, I perform validations by opening a new session from the same session factory (using FlushMode.NEVER, and never calling flush). It is actually this parallel session which is somehow causing these headaches. What ends up happening, is that the seperate session performs queries and loads, but never any type of INSERT/DELETE/UPDATE. But as part of the calls on that seperate session, I see log messages like the following all over the logs:
Code:
2003-10-01 19:32:10,958 DEBUG [l.updateReachableCollection(SessionImpl.java:2800)] - Collection found: [com.vignette.it.apps.server.domain.entities.TrainingClass.scheduledInstructors#255337], was: [com.vignette.it.apps.server.domain.entities.TrainingClass.scheduledInstructors#255337]
2003-10-01 19:32:10,958 DEBUG [l.updateReachableCollection(SessionImpl.java:2800)] - Collection found: [com.vignette.it.apps.server.domain.entities.TrainingClass.enrollments#255337], was: [com.vignette.it.apps.server.domain.entities.TrainingClass.enrollments#255337]
2003-10-01 19:32:10,958 DEBUG [essionImpl.flushCollections(SessionImpl.java:2642)] - Processing unreferenced collections
2003-10-01 19:32:10,958 DEBUG [updateUnreachableCollection(SessionImpl.java:2852)] - Collection dereferenced: [com.vignette.it.apps.server.domain.entities.CourseVersion.materials#254295]
2003-10-01 19:32:10,958 DEBUG [updateUnreachableCollection(SessionImpl.java:2852)] - Collection dereferenced: [com.vignette.it.apps.server.domain.entities.CourseVersion.localizedSyllabusMap#254295]
2003-10-01 19:32:10,968 DEBUG [updateUnreachableCollection(SessionImpl.java:2852)] - Collection dereferenced: [com.vignette.it.apps.server.domain.entities.Course.qualifiedInstructors#254276]
2003-10-01 19:32:10,968 DEBUG [updateUnreachableCollection(SessionImpl.java:2852)] - Collection dereferenced: [com.vignette.it.apps.server.domain.entities.Course.relatedCourses#254276]
2003-10-01 19:32:10,968 DEBUG [updateUnreachableCollection(SessionImpl.java:2852)] - Collection dereferenced: [com.vignette.it.apps.server.domain.entities.Course.associatedTrainingProducts#254276]
2003-10-01 19:32:10,968 DEBUG [updateUnreachableCollection(SessionImpl.java:2852)] - Collection dereferenced: [com.vignette.it.apps.server.domain.entities.Course.tracks#254276]
2003-10-01 19:32:10,968 DEBUG [updateUnreachableCollection(SessionImpl.java:2852)] - Collection dereferenced: [com.vignette.it.apps.server.domain.entities.Course.notes#254276]
2003-10-01 19:32:10,968 DEBUG [essionImpl.flushCollections(SessionImpl.java:2653)] - Scheduling collection removes/(re)creates/updates
2003-10-01 19:32:10,978 DEBUG [SessionImpl.flushEverything(SessionImpl.java:2226)] - Flushed: 0 insertions, 1 updates, 0 deletions to 4 objects
2003-10-01 19:32:10,978 DEBUG [SessionImpl.flushEverything(SessionImpl.java:2231)] - Flushed: 0 (re)creations, 0 updates, 7 removals to 9 collections
Should opening this secondary session be a problem? We spoke about this a long time back (on the old forums) and the consensus then was that doing this was OK. Maybe thats changed now?