-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: collection was not processed by flush()
PostPosted: Thu Nov 15, 2012 11:59 pm 
Newbie

Joined: Thu Nov 15, 2012 9:54 pm
Posts: 4
When I run this method, I get error "collection was not processed by flush()"


public static boolean isAligned(Session session, CourseRequirement coursereq, InstructionalMethod method){
if (coursereq==null || method == null){
return false;
}
Query query = session.createQuery("SELECT cglo FROM CourseRequirementInstructionalMethod cglo " +
"WHERE cglo.unit.id= :uid AND cglo.method.id= :mid");
query.setLong("uid", coursereq.getId());
query.setLong("mid", method.getId());
List list = query.list();
if (list!=null && list.size()>0){
return true;
}
return false;
}


19:49:21,785 ERROR [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 [com.cmaps.core.persist.types.AssessmentInstrumentPerformanceObjective.studentperformances] 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.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:65)
at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:996)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1141)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
at com.cmaps.core.persist.dao.CourseRequirementInstructionalMethodDao.isAligned(CourseRequirementInstructionalMethodDao.java:39)
at com.cmaps.servlet.AjaxUpdateCourseRequirementInstructionalMethodServlet.doAjax(AjaxUpdateCourseRequirementInstructionalMethodServlet.java:38)
at com.cmaps.servlet.AjaxServlet.doGet(AjaxServlet.java:23)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:601)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)
19:49:21,785 ERROR [[AjaxUpdateCourseRequirementInstructionalMethodServlet]] Servlet.service() for servlet AjaxUpdateCourseRequirementInstructionalMethodServlet threw exception


Top
 Profile  
 
 Post subject: Re: collection was not processed by flush()
PostPosted: Mon Nov 19, 2012 5:41 am 
Expert
Expert

Joined: Tue Jun 16, 2009 3:36 am
Posts: 990
As the error message says, the error is most likely caused due to unsafe use of the session.
An important rule is for example that never 2 concurrent threads should operate with the same hiberante session.
You have to check, if you use hibernate sessions properly.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.