Hibernate Books

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 14 posts ] 
Author Message
 Post subject: Flush during cascade is dangerous Exception
PostPosted: Sat May 24, 2008 7:25 am 
Newbie

Joined: Fri Dec 28, 2007 7:38 am
Posts: 16
hai every one

this is my project environment
jboss seam: 2.1.0.A1
jboss server:4.2.2.GA
I my page I display the huge amount of data displayed in the table form
I fetch those data by using EJP 3 by using PersistenceContext
When more than one person try to access that particular page at a time
I got following exception
How can I fix this exception?

Code:
04:59:34,837 WARN  [arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator_2] TwoPhaseCoordinator.beforeCompletion - failed for com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple@1c7ee02f
javax.persistence.PersistenceException: org.hibernate.HibernateException: Flush during cascade is dangerous
   at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:629)
   at org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:524)
   at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.beforeCompletion(SynchronizationImple.java:114)
   at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:247)
   at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:86)
   at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:177)
   at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1389)
   at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:135)
   at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:87)
   at org.jboss.tm.usertx.client.ServerVMClientUserTransaction.commit(ServerVMClientUserTransaction.java:140)
   at org.jboss.seam.transaction.UTTransaction.commit(UTTransaction.java:52)
   at org.jboss.seam.jsf.SeamPhaseListener.commitOrRollback(SeamPhaseListener.java:605)
   at org.jboss.seam.jsf.SeamPhaseListener.handleTransactionsAfterPageActions(SeamPhaseListener.java:352)
   at org.jboss.seam.jsf.SeamPhaseListener.preRenderPage(SeamPhaseListener.java:571)
   at org.jboss.seam.jsf.SeamPhaseListener.beforeRenderResponse(SeamPhaseListener.java:473)
   at org.jboss.seam.jsf.SeamPhaseListener.beforeServletPhase(SeamPhaseListener.java:146)
   at org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:116)
   at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:222)
   at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
   at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
   at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
   at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
   at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
   at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
   at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
   at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
   at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
   at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
   at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
   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:230)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
   at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
   at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
   at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
   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:157)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
   at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
   at java.lang.Thread.run(Thread.java:595)
Caused by: org.hibernate.HibernateException: Flush during cascade is dangerous
   at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:996)
   at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
   at org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:515)
   ... 56 more


is there any help
by
Thiagu.m


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 25, 2008 2:55 pm 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
It looks like you are calling flush() in your code to push a change to your database. My guess is that this call to flush is not needed, and Hiberante is getting a little annoyed by it.

Find the flush() calls in your code and justify why they are needed. My guess is that they probably are not needed, and a the committing of your Hibernate transaction will suffice.

_________________
Cameron McKenzie - Author of "Hibernate Made Easy" and "What is WebSphere?"
http://www.TheBookOnHibernate.com Check out my 'easy to follow' Hibernate & JPA Tutorials


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 27, 2008 3:37 am 
Newbie

Joined: Fri Dec 28, 2007 7:38 am
Posts: 16
thank u for your reply

i comment all the em.flush() in my code
after that i got a new Exception like this

Code:
10:33:31,625 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 was processed twice by flush()
   at org.hibernate.engine.Collections.prepareCollectionForUpdate(Collections.java:202)
   at org.hibernate.engine.Collections.processDereferencedCollection(Collections.java:106)
   at org.hibernate.engine.Collections.processUnreachableCollection(Collections.java:39)
   at org.hibernate.event.def.AbstractFlushingEventListener.flushCollections(AbstractFlushingEventListener.java:218)
   at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:77)
   at org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:35)
   at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:969)
   at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1114)
   at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
   at org.hibernate.ejb.QueryImpl.getSingleResult(QueryImpl.java:80)
   at session.beans.ProductsAction.selectFromRequest(ProductsAction.java:320)
   at sun.reflect.GeneratedMethodAccessor939.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
   at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
   at org.jboss.seam.intercept.EJBInvocationContext.proceed(EJBInvocationContext.java:44)
   at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
   at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:31)
   at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
   at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:46)
   at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
   at org.jboss.seam.core.ConversationInterceptor.aroundInvoke(ConversationInterceptor.java:56)
   at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
   at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
   at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
   at org.jboss.seam.persistence.EntityManagerProxyInterceptor.aroundInvoke(EntityManagerProxyInterceptor.java:26)
   at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
   at org.jboss.seam.persistence.HibernateSessionProxyInterceptor.aroundInvoke(HibernateSessionProxyInterceptor.java:27)
   at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
   at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
   at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:50)
   at sun.reflect.GeneratedMethodAccessor187.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
   at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
   at org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor.invoke(ExtendedPersistenceContextPropagationInterceptor.java:57)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
   at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
   at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
   at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
   at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
   at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:95)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
   at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:83)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
   at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
   at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
   at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
   at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
   at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:206)
   at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:119)
   at $Proxy148.selectFromRequest(Unknown Source)
   at sun.reflect.GeneratedMethodAccessor938.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
   at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
   at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:76)
   at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
   at org.jboss.seam.ejb.RemoveInterceptor.aroundInvoke(RemoveInterceptor.java:41)
   at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
   at org.jboss.seam.core.SynchronizationInterceptor.aroundInvoke(SynchronizationInterceptor.java:32)
   at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
   at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
   at org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:54)
   at org.javassist.tmp.java.lang.Object_$$_javassist_3.selectFromRequest(Object_$$_javassist_3.java)
   at sun.reflect.GeneratedMethodAccessor937.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:329)
   at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:342)
   at org.jboss.el.parser.AstPropertySuffix.invoke(AstPropertySuffix.java:58)
   at org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
   at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
   at org.jboss.seam.core.Expressions$2.invoke(Expressions.java:173)
   at org.jboss.seam.navigation.Pages.callAction(Pages.java:630)
   at org.jboss.seam.navigation.Pages.preRender(Pages.java:289)
   at org.jboss.seam.jsf.SeamPhaseListener.preRenderPage(SeamPhaseListener.java:562)
   at org.jboss.seam.jsf.SeamPhaseListener.beforeRenderResponse(SeamPhaseListener.java:473)
   at org.jboss.seam.jsf.SeamPhaseListener.beforeServletPhase(SeamPhaseListener.java:146)
   at org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:116)
   at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:222)
   at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
   at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
   at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
   at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
   at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
   at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
   at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
   at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
   at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
   at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
   at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
   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:230)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
   at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
   at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
   at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
   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:157)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
   at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
   at java.lang.Thread.run(Thread.java:595)


is there any idea to fix this one

By
Thiagu.m


Top
 Profile  
 
 Post subject: Perhaps a Seam, Ajax, Hibernate interaction problem?
PostPosted: Sat May 31, 2008 12:16 pm 
Newbie

Joined: Thu Jul 12, 2007 9:09 am
Posts: 7
Hi Thiagu,

I think you might be having the same problem that I had in a project. Take a look at http://blogs.comarretechnologies.com/?p=6. Our problem was the simultaneous AJAX requests were causing the same hibernate session to be flushed at the same time, causing the different errors that you are seeing.

John.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 03, 2008 1:50 am 
Newbie

Joined: Fri Dec 28, 2007 7:38 am
Posts: 16
Dear John,

Your suggestion to refer http://blogs.comarretechnologies.com/?p=6 was really helpful.

thank u very much

Regards
Thiagu. M


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 03, 2008 2:23 am 
Newbie

Joined: Thu Jul 12, 2007 9:09 am
Posts: 7
I'm glad it fixed your problem. There is nothing worse than strange intermittent problems that make no sense.


Top
 Profile  
 
 Post subject: Re: Flush during cascade is dangerous Exception
PostPosted: Tue Jun 16, 2009 2:22 am 
Newbie

Joined: Wed Dec 24, 2008 4:35 am
Posts: 2
Hi John,
following link is not working.

http://blogs.comarretechnologies.com/?p=6


Top
 Profile  
 
 Post subject: Re: Flush during cascade is dangerous Exception
PostPosted: Mon Apr 25, 2011 12:16 pm 
Newbie

Joined: Mon Apr 25, 2011 12:14 pm
Posts: 1
I'm also having the same problem...

How did you fix the problem? The blog URL isn't active... :(


Top
 Profile  
 
 Post subject: Re: Flush during cascade is dangerous Exception
PostPosted: Wed Oct 12, 2011 4:00 pm 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
Having the same problem here, quite likely to do with Ajax requests too. Anyone know the solution or have a link to an archive of that blog post?

_________________
Code tags are your friend. Know them and use them.


Top
 Profile  
 
 Post subject: Re: Flush during cascade is dangerous Exception
PostPosted: Wed Oct 12, 2011 4:36 pm 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
Just reverted from jdk6u27 to jdk6u25 and the problem went away. Hibernate, you're in the clear!

_________________
Code tags are your friend. Know them and use them.


Top
 Profile  
 
 Post subject: Re: Flush during cascade is dangerous Exception
PostPosted: Thu Oct 13, 2011 9:01 am 
Newbie

Joined: Thu Oct 13, 2011 8:55 am
Posts: 1
hi

refer to following link http://blogs.comarretechnologies.com/?p=6

thanks

Regards
hectorho

http://www.hisandeep.com


Top
 Profile  
 
 Post subject: Re: Flush during cascade is dangerous Exception
PostPosted: Thu Oct 13, 2011 3:33 pm 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
Have tried to. Link doesn't work.

_________________
Code tags are your friend. Know them and use them.


Top
 Profile  
 
 Post subject: Re: Flush during cascade is dangerous Exception
PostPosted: Fri Jun 08, 2012 5:32 am 
Newbie

Joined: Thu Sep 08, 2011 4:44 am
Posts: 2
Hi, I have the same problem since months!

Is it so difficult to post a description and solution of the problem here?

Thanks!


Top
 Profile  
 
 Post subject: Re: Flush during cascade is dangerous Exception
PostPosted: Fri Apr 05, 2013 5:58 am 
Newbie

Joined: Fri Apr 05, 2013 5:42 am
Posts: 2
Hi

I am getting this exception (Flush during cascade is dangerous) sometimes. This is really disturbing me and I am not able to find the cause of it.

My code is like:

int count =0;
try {
foreTime = Functions.getDate(
record.getDateTime(),
"dd/MM/yyyy HH:mm");
targetDateTime = Functions.getDate(record.getTargetDateTime(),"dd/MM/yyyy HH:mm");
logger.debug("targetDateTime:" + targetDateTime);
} catch (Exception e) {
logger.error("Error while validating date");

}
if (errorFlag == false) {
logger.info("inserting into database");
try {

foreData = new ForeData();
compoundKey = new ForeDataCompoundKey();
compoundKey.setForeTime(Functions.getDate(record.getForeTime(),"dd/MM/yyyy HH:mm"));
compoundKey.setForeId(foreId);
----
---
updateWeatherForecastData(weatherForecastData,fileName, session);
if (++count % 1000 == 0) {
session.flush();
}
output.info("updating the database");
// tx.commit();
} catch (HibernateException e) {

errorMessage = sqlEx.getMessage();
errorCode = sqlEx.getErrorCode();
message = "Error in inserting weather forecast data in WEATHER_FRCST_DATA table";
throw new QueryException("Exception occured");
}


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 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.