For more details see the attached testcase. I'm sorry, but in the short of time i only got a testcase for jboss-server 4.2. Please deploy the server.ear from /release-directory and then call the /src/client/TestCaseClient.java.
I have two entities A.class and B.class defined, both inheriting from an common (empty) abstract MappedSuperclass. A and B having a m:n relation between each other. Furthermore there is an PostUpdateListener, which iterates through all properties of updated entities.
Both entities are linked with each (m:n), now i do an update of a simple property of entity A --> MyPostUpdateListener will be called, which iterates through each property of the updated entity(ies). In case of this property was a collection (= property of the m:n relation), the listener furthermore iterates through this collection and get the id of each object in the collection. Doing so will raise following exception :
Caused by: org.hibernate.AssertionFailure: collection [com.qualitype.testcase.server.ejb.entity.EntityB.entitiesOfA] was not processed by flush()
... 29 more
Summarized these error will only occur, in case we are inherating from a mappedSuperClass, having a m:n relation and having the listener touching the collection-elements. But these scenario isn'n very uncommon. We are using hibernate-event listener system for auditing-purposes, so you should understand that touching ever (element in the) collectin is necessary for audit-purposes.
Seems for me like a bug. Need this fixed asap ...
Windows-XP, Jboss 4.2 GA, Hibernate 3.2.1GA, EJB3