org.hibernate.AssertionFailure: collection was not processed by flush()

Hibernate JIRA | Robert Herschke | 1 decade ago
  1. 0

    I have the following mapping: <class name="A"> <id name="idx"> <generator class="uuid"/> </id> <property name="test"/> <any name="any" id-type="string" meta-type="string" cascade="none"> <column name="any_type"/> <column name="any_id"/> </any> </class> and: <class name="B"> <id name="idx"> <generator class="uuid"/> </id> <set name="as"> <key column="B_as_idx" not-null="false"/> <one-to-many class="A"/> </set> </class> Now I do the following: At first I like to create some objects: Session s = sf.openSession(); Transaction tx = s.beginTransaction(); A a = new A(); Serializable idx = s.save(a); B b = new B(); s.save(b); a.setAny(b); s.update(a); b.getAs().add(a); s.update(b); tx.commit(); s.close(); At next I like to modify A: s = sf.openSession(); tx = s.beginTransaction(); A a2 = (A)s.get(A.class, idx); a2.setTest("hallo!"); s.update(a2); tx.commit(); s.close(); And it crashes at the second commit() with: Exception in thread "main" org.hibernate.AssertionFailure: collection was not processed by flush() at org.hibernate.engine.CollectionEntry.postFlush(CollectionEntry.java:144) at org.hibernate.event.def.AbstractFlushingEventListener.postFlush(AbstractFlushingEventListener.java:305) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:28) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:730) at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:324) at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:86) at test.Test.main(Test.java:53) I've attached a testcase, but please change the hibernate.ora.cfg.xml with your parameters.

    Hibernate JIRA | 1 decade ago | Robert Herschke
    org.hibernate.AssertionFailure: collection was not processed by flush()
  2. 0

    I have the following mapping: <class name="A"> <id name="idx"> <generator class="uuid"/> </id> <property name="test"/> <any name="any" id-type="string" meta-type="string" cascade="none"> <column name="any_type"/> <column name="any_id"/> </any> </class> and: <class name="B"> <id name="idx"> <generator class="uuid"/> </id> <set name="as"> <key column="B_as_idx" not-null="false"/> <one-to-many class="A"/> </set> </class> Now I do the following: At first I like to create some objects: Session s = sf.openSession(); Transaction tx = s.beginTransaction(); A a = new A(); Serializable idx = s.save(a); B b = new B(); s.save(b); a.setAny(b); s.update(a); b.getAs().add(a); s.update(b); tx.commit(); s.close(); At next I like to modify A: s = sf.openSession(); tx = s.beginTransaction(); A a2 = (A)s.get(A.class, idx); a2.setTest("hallo!"); s.update(a2); tx.commit(); s.close(); And it crashes at the second commit() with: Exception in thread "main" org.hibernate.AssertionFailure: collection was not processed by flush() at org.hibernate.engine.CollectionEntry.postFlush(CollectionEntry.java:144) at org.hibernate.event.def.AbstractFlushingEventListener.postFlush(AbstractFlushingEventListener.java:305) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:28) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:730) at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:324) at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:86) at test.Test.main(Test.java:53) I've attached a testcase, but please change the hibernate.ora.cfg.xml with your parameters.

    Hibernate JIRA | 1 decade ago | Robert Herschke
    org.hibernate.AssertionFailure: collection was not processed by flush()
  3. 0

    We've started to notice the following exceptions being triggered from Hibernate 3.5.0-SNAPSHOT (built locally), but only under certain circumstances (editing a specific user, whilst being logged into the application as a specific user). After stepping through both our application and hibernate through the whole update/commit process being run, I can't find anything that would be causing this problem. During processing, I see calls to org.hibernate.engine.Collections#prepareCollectionForUpdate for CollectionEntry[smx3.schema.PartyRole.agreementsFrom#2006094] (and other elements in the same collection) which is listed in the trace below. The collection which triggers the exception isn't consistently the same one, but seems to be localized to 4-5 different collections, I've also noticed that if I single-stepping through the process, if sometimes completes fine, which may indicate some race conditions somewhere. As I'm not entirely sure why the exception is being thrown, I'm not sure if this is a problem with Hibernate, or something wrong in our application somewhere. Is there anyway I can identify why a collection entry wouldn't have been processed (and what does "processed" actually mean?). 24.04.2009 15:57:33.180 *ERROR* [btpool0-1] org.hibernate.AssertionFailure an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session) org.hibernate.AssertionFailure: collection [smx3.schema.PartyRole.agreementsFrom] was not processed by flush() at org.hibernate.engine.CollectionEntry.postFlush(CollectionEntry.java:228) at org.hibernate.event.def.AbstractFlushingEventListener.postFlush(AbstractFlushingEventListener.java:356) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1031) at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:369) at org.hibernate.transaction.CacheSynchronization.beforeCompletion(CacheSynchronization.java:88) at com.atomikos.icatch.jta.Sync2Sync.beforeCompletion(Sync2Sync.java:73) at com.atomikos.icatch.imp.TransactionStateHandler.commit(TransactionStateHandler.java:253) at com.atomikos.icatch.imp.CompositeTransactionImp.doCommit(CompositeTransactionImp.java:509) at com.atomikos.icatch.imp.CompositeTerminatorImp.commit(CompositeTerminatorImp.java:138) at com.atomikos.icatch.jta.TransactionImp.commit(TransactionImp.java:297) at com.atomikos.icatch.jta.TransactionManagerImp.commit(TransactionManagerImp.java:608) at com.atomikos.icatch.jta.UserTransactionManager.commit(UserTransactionManager.java:148) at smx3.envers.TransactionFilter.afterHandle(TransactionFilter.java:242) at org.restlet.Filter.handle(Filter.java:197) at org.restlet.Filter.doHandle(Filter.java:150) at org.restlet.Filter.handle(Filter.java:195) at org.restlet.Filter.doHandle(Filter.java:150) at org.restlet.Filter.handle(Filter.java:195) at org.restlet.Filter.doHandle(Filter.java:150) at com.noelios.restlet.StatusFilter.doHandle(StatusFilter.java:130) at org.restlet.Filter.handle(Filter.java:195) at org.restlet.Filter.doHandle(Filter.java:150) at org.restlet.Filter.handle(Filter.java:195) at com.noelios.restlet.ChainHelper.handle(ChainHelper.java:124) at com.noelios.restlet.application.ApplicationHelper.handle(ApplicationHelper.java:112) at org.restlet.Application.handle(Application.java:341) at org.restlet.ext.wadl.WadlApplication.handle(WadlApplication.java:705) at org.restlet.Filter.doHandle(Filter.java:150) at org.restlet.Filter.handle(Filter.java:195) at org.restlet.Router.handle(Router.java:504) at org.restlet.Filter.doHandle(Filter.java:150) at org.restlet.Filter.handle(Filter.java:195) at org.restlet.Router.handle(Router.java:504) at org.restlet.Filter.doHandle(Filter.java:150) at org.restlet.Filter.handle(Filter.java:195) at com.noelios.restlet.ChainHelper.handle(ChainHelper.java:124) at org.restlet.Component.handle(Component.java:673) at org.restlet.Server.handle(Server.java:331) at com.noelios.restlet.ServerHelper.handle(ServerHelper.java:68) at com.noelios.restlet.http.HttpServerHelper.handle(HttpServerHelper.java:147) at com.noelios.restlet.ext.servlet.ServerServlet.service(ServerServlet.java:881) at nz.co.smx.rest.RestActivator$RestActivatorClassLoaderServlet.service(RestActivator.java:182) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362) at org.ops4j.pax.web.service.internal.HttpServiceServletHandler.handle(HttpServiceServletHandler.java:51) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:722) at org.ops4j.pax.web.service.internal.HttpServiceContext.handle(HttpServiceContext.java:87) at org.ops4j.pax.web.service.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:63) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139) at org.mortbay.jetty.Server.handle(Server.java:324) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505) at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:842) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:648) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380) at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228) at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:450) 24.04.2009 15:57:33.183 *WARN* [btpool0-1] atomikos Unexpected error in beforeCompletion: org.hibernate.AssertionFailure: collection [smx3.schema.PartyRole.agreementsFrom] was not processed by flush() at org.hibernate.engine.CollectionEntry.postFlush(CollectionEntry.java:228) at org.hibernate.event.def.AbstractFlushingEventListener.postFlush(AbstractFlushingEventListener.java:356) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1031) at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:369) at org.hibernate.transaction.CacheSynchronization.beforeCompletion(CacheSynchronization.java:88) at com.atomikos.icatch.jta.Sync2Sync.beforeCompletion(Sync2Sync.java:73) at com.atomikos.icatch.imp.TransactionStateHandler.commit(TransactionStateHandler.java:253) at com.atomikos.icatch.imp.CompositeTransactionImp.doCommit(CompositeTransactionImp.java:509) at com.atomikos.icatch.imp.CompositeTerminatorImp.commit(CompositeTerminatorImp.java:138) at com.atomikos.icatch.jta.TransactionImp.commit(TransactionImp.java:297) at com.atomikos.icatch.jta.TransactionManagerImp.commit(TransactionManagerImp.java:608) at com.atomikos.icatch.jta.UserTransactionManager.commit(UserTransactionManager.java:148) at smx3.envers.TransactionFilter.afterHandle(TransactionFilter.java:242) at org.restlet.Filter.handle(Filter.java:197) at org.restlet.Filter.doHandle(Filter.java:150) at org.restlet.Filter.handle(Filter.java:195) at org.restlet.Filter.doHandle(Filter.java:150) at org.restlet.Filter.handle(Filter.java:195) at org.restlet.Filter.doHandle(Filter.java:150) at com.noelios.restlet.StatusFilter.doHandle(StatusFilter.java:130) at org.restlet.Filter.handle(Filter.java:195) at org.restlet.Filter.doHandle(Filter.java:150) at org.restlet.Filter.handle(Filter.java:195) at com.noelios.restlet.ChainHelper.handle(ChainHelper.java:124) at com.noelios.restlet.application.ApplicationHelper.handle(ApplicationHelper.java:112) at org.restlet.Application.handle(Application.java:341) at org.restlet.ext.wadl.WadlApplication.handle(WadlApplication.java:705) at org.restlet.Filter.doHandle(Filter.java:150) at org.restlet.Filter.handle(Filter.java:195) at org.restlet.Router.handle(Router.java:504) at org.restlet.Filter.doHandle(Filter.java:150) at org.restlet.Filter.handle(Filter.java:195) at org.restlet.Router.handle(Router.java:504) at org.restlet.Filter.doHandle(Filter.java:150) at org.restlet.Filter.handle(Filter.java:195) at com.noelios.restlet.ChainHelper.handle(ChainHelper.java:124) at org.restlet.Component.handle(Component.java:673) at org.restlet.Server.handle(Server.java:331) at com.noelios.restlet.ServerHelper.handle(ServerHelper.java:68) at com.noelios.restlet.http.HttpServerHelper.handle(HttpServerHelper.java:147) at com.noelios.restlet.ext.servlet.ServerServlet.service(ServerServlet.java:881) at nz.co.smx.rest.RestActivator$RestActivatorClassLoaderServlet.service(RestActivator.java:182) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362) at org.ops4j.pax.web.service.internal.HttpServiceServletHandler.handle(HttpServiceServletHandler.java:51) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:722) at org.ops4j.pax.web.service.internal.HttpServiceContext.handle(HttpServiceContext.java:87) at org.ops4j.pax.web.service.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:63) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139) at org.mortbay.jetty.Server.handle(Server.java:324) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505) at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:842) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:648) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380) at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228) at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:450)

    Hibernate JIRA | 8 years ago | Mark Derricutt
    org.hibernate.AssertionFailure: collection [smx3.schema.PartyRole.agreementsFrom] was not processed by flush()
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    We've started to notice the following exceptions being triggered from Hibernate 3.5.0-SNAPSHOT (built locally), but only under certain circumstances (editing a specific user, whilst being logged into the application as a specific user). After stepping through both our application and hibernate through the whole update/commit process being run, I can't find anything that would be causing this problem. During processing, I see calls to org.hibernate.engine.Collections#prepareCollectionForUpdate for CollectionEntry[smx3.schema.PartyRole.agreementsFrom#2006094] (and other elements in the same collection) which is listed in the trace below. The collection which triggers the exception isn't consistently the same one, but seems to be localized to 4-5 different collections, I've also noticed that if I single-stepping through the process, if sometimes completes fine, which may indicate some race conditions somewhere. As I'm not entirely sure why the exception is being thrown, I'm not sure if this is a problem with Hibernate, or something wrong in our application somewhere. Is there anyway I can identify why a collection entry wouldn't have been processed (and what does "processed" actually mean?). 24.04.2009 15:57:33.180 *ERROR* [btpool0-1] org.hibernate.AssertionFailure an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session) org.hibernate.AssertionFailure: collection [smx3.schema.PartyRole.agreementsFrom] was not processed by flush() at org.hibernate.engine.CollectionEntry.postFlush(CollectionEntry.java:228) at org.hibernate.event.def.AbstractFlushingEventListener.postFlush(AbstractFlushingEventListener.java:356) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1031) at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:369) at org.hibernate.transaction.CacheSynchronization.beforeCompletion(CacheSynchronization.java:88) at com.atomikos.icatch.jta.Sync2Sync.beforeCompletion(Sync2Sync.java:73) at com.atomikos.icatch.imp.TransactionStateHandler.commit(TransactionStateHandler.java:253) at com.atomikos.icatch.imp.CompositeTransactionImp.doCommit(CompositeTransactionImp.java:509) at com.atomikos.icatch.imp.CompositeTerminatorImp.commit(CompositeTerminatorImp.java:138) at com.atomikos.icatch.jta.TransactionImp.commit(TransactionImp.java:297) at com.atomikos.icatch.jta.TransactionManagerImp.commit(TransactionManagerImp.java:608) at com.atomikos.icatch.jta.UserTransactionManager.commit(UserTransactionManager.java:148) at smx3.envers.TransactionFilter.afterHandle(TransactionFilter.java:242) at org.restlet.Filter.handle(Filter.java:197) at org.restlet.Filter.doHandle(Filter.java:150) at org.restlet.Filter.handle(Filter.java:195) at org.restlet.Filter.doHandle(Filter.java:150) at org.restlet.Filter.handle(Filter.java:195) at org.restlet.Filter.doHandle(Filter.java:150) at com.noelios.restlet.StatusFilter.doHandle(StatusFilter.java:130) at org.restlet.Filter.handle(Filter.java:195) at org.restlet.Filter.doHandle(Filter.java:150) at org.restlet.Filter.handle(Filter.java:195) at com.noelios.restlet.ChainHelper.handle(ChainHelper.java:124) at com.noelios.restlet.application.ApplicationHelper.handle(ApplicationHelper.java:112) at org.restlet.Application.handle(Application.java:341) at org.restlet.ext.wadl.WadlApplication.handle(WadlApplication.java:705) at org.restlet.Filter.doHandle(Filter.java:150) at org.restlet.Filter.handle(Filter.java:195) at org.restlet.Router.handle(Router.java:504) at org.restlet.Filter.doHandle(Filter.java:150) at org.restlet.Filter.handle(Filter.java:195) at org.restlet.Router.handle(Router.java:504) at org.restlet.Filter.doHandle(Filter.java:150) at org.restlet.Filter.handle(Filter.java:195) at com.noelios.restlet.ChainHelper.handle(ChainHelper.java:124) at org.restlet.Component.handle(Component.java:673) at org.restlet.Server.handle(Server.java:331) at com.noelios.restlet.ServerHelper.handle(ServerHelper.java:68) at com.noelios.restlet.http.HttpServerHelper.handle(HttpServerHelper.java:147) at com.noelios.restlet.ext.servlet.ServerServlet.service(ServerServlet.java:881) at nz.co.smx.rest.RestActivator$RestActivatorClassLoaderServlet.service(RestActivator.java:182) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362) at org.ops4j.pax.web.service.internal.HttpServiceServletHandler.handle(HttpServiceServletHandler.java:51) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:722) at org.ops4j.pax.web.service.internal.HttpServiceContext.handle(HttpServiceContext.java:87) at org.ops4j.pax.web.service.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:63) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139) at org.mortbay.jetty.Server.handle(Server.java:324) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505) at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:842) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:648) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380) at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228) at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:450) 24.04.2009 15:57:33.183 *WARN* [btpool0-1] atomikos Unexpected error in beforeCompletion: org.hibernate.AssertionFailure: collection [smx3.schema.PartyRole.agreementsFrom] was not processed by flush() at org.hibernate.engine.CollectionEntry.postFlush(CollectionEntry.java:228) at org.hibernate.event.def.AbstractFlushingEventListener.postFlush(AbstractFlushingEventListener.java:356) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1031) at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:369) at org.hibernate.transaction.CacheSynchronization.beforeCompletion(CacheSynchronization.java:88) at com.atomikos.icatch.jta.Sync2Sync.beforeCompletion(Sync2Sync.java:73) at com.atomikos.icatch.imp.TransactionStateHandler.commit(TransactionStateHandler.java:253) at com.atomikos.icatch.imp.CompositeTransactionImp.doCommit(CompositeTransactionImp.java:509) at com.atomikos.icatch.imp.CompositeTerminatorImp.commit(CompositeTerminatorImp.java:138) at com.atomikos.icatch.jta.TransactionImp.commit(TransactionImp.java:297) at com.atomikos.icatch.jta.TransactionManagerImp.commit(TransactionManagerImp.java:608) at com.atomikos.icatch.jta.UserTransactionManager.commit(UserTransactionManager.java:148) at smx3.envers.TransactionFilter.afterHandle(TransactionFilter.java:242) at org.restlet.Filter.handle(Filter.java:197) at org.restlet.Filter.doHandle(Filter.java:150) at org.restlet.Filter.handle(Filter.java:195) at org.restlet.Filter.doHandle(Filter.java:150) at org.restlet.Filter.handle(Filter.java:195) at org.restlet.Filter.doHandle(Filter.java:150) at com.noelios.restlet.StatusFilter.doHandle(StatusFilter.java:130) at org.restlet.Filter.handle(Filter.java:195) at org.restlet.Filter.doHandle(Filter.java:150) at org.restlet.Filter.handle(Filter.java:195) at com.noelios.restlet.ChainHelper.handle(ChainHelper.java:124) at com.noelios.restlet.application.ApplicationHelper.handle(ApplicationHelper.java:112) at org.restlet.Application.handle(Application.java:341) at org.restlet.ext.wadl.WadlApplication.handle(WadlApplication.java:705) at org.restlet.Filter.doHandle(Filter.java:150) at org.restlet.Filter.handle(Filter.java:195) at org.restlet.Router.handle(Router.java:504) at org.restlet.Filter.doHandle(Filter.java:150) at org.restlet.Filter.handle(Filter.java:195) at org.restlet.Router.handle(Router.java:504) at org.restlet.Filter.doHandle(Filter.java:150) at org.restlet.Filter.handle(Filter.java:195) at com.noelios.restlet.ChainHelper.handle(ChainHelper.java:124) at org.restlet.Component.handle(Component.java:673) at org.restlet.Server.handle(Server.java:331) at com.noelios.restlet.ServerHelper.handle(ServerHelper.java:68) at com.noelios.restlet.http.HttpServerHelper.handle(HttpServerHelper.java:147) at com.noelios.restlet.ext.servlet.ServerServlet.service(ServerServlet.java:881) at nz.co.smx.rest.RestActivator$RestActivatorClassLoaderServlet.service(RestActivator.java:182) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362) at org.ops4j.pax.web.service.internal.HttpServiceServletHandler.handle(HttpServiceServletHandler.java:51) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:722) at org.ops4j.pax.web.service.internal.HttpServiceContext.handle(HttpServiceContext.java:87) at org.ops4j.pax.web.service.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:63) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139) at org.mortbay.jetty.Server.handle(Server.java:324) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505) at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:842) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:648) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380) at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228) at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:450)

    Hibernate JIRA | 8 years ago | Mark Derricutt
    org.hibernate.AssertionFailure: collection [smx3.schema.PartyRole.agreementsFrom] was not processed by flush()
  6. 0

    The problem occurs when insert or update listener is created on hibernate session on model with many-to-many collection and listener is making some queries with this model. The listener is needed for checking data integrity , so I need to make some select clauses within this listener. That is my code from PreInsertEventListener.onPreInsert() method (some lines were removed for clearance) : //I set this on FlushMode.NEVER because StackOverflowError is thrown event.getSession().setFlushMode(FlushMode.NEVER); // Function below makes database query using criteria API String o = listener.validate(event.getEntity(),event.getSession()); if (o != null) { // I don't know if this is correct, but why not?? I don't catch this exception in my code and I have auto_close_session and auto_flush_session on true throw new ConstraintViolationException(o,null,null); } // set to default settings event.getSession().setFlushMode(FlushMode.AUTO); That's exception from my WebLogic 8.1 server <2005-05-05 18:05:15 CEST> <Error> <org.hibernate.AssertionFailure> <000000> <an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session) org.hibernate.AssertionFailure: collection was not processed by flush() at org.hibernate.engine.CollectionEntry.postFlush(CollectionEntry.java:144) at org.hibernate.event.def.AbstractFlushingEventListener.postFlush(AbstractFlushingEventListener.java:305) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:28) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:678) at pl.softbank.cepik.modris.common.client.util.DefaultModrisClient.updateObject(DefaultModrisClient.java:196) at pl.softbank.cepik.modris.dict.common.client.CommonDictModrisClient.insert(CommonDictModrisClient.java:71)

    Hibernate JIRA | 1 decade ago | Tom Kucharski
    org.hibernate.AssertionFailure: collection was not processed by flush()

  1. musketyr 4 times, last 1 month ago
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. org.hibernate.AssertionFailure

    collection was not processed by flush()

    at org.hibernate.engine.CollectionEntry.postFlush()
  2. Hibernate
    CollectionEntry.postFlush
    1. org.hibernate.engine.CollectionEntry.postFlush(CollectionEntry.java:144)
    1 frame
  3. Hibernate
    SessionImpl.managedFlush
    1. org.hibernate.event.def.AbstractFlushingEventListener.postFlush(AbstractFlushingEventListener.java:305)
    2. org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:28)
    3. org.hibernate.impl.SessionImpl.flush(SessionImpl.java:730)
    4. org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:324)
    4 frames
  4. Hibernate
    JDBCTransaction.commit
    1. org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:86)
    1 frame
  5. test
    Test.main
    1. test.Test.main(Test.java:53)
    1 frame