Announcement Announcement Module
Collapse
No announcement yet.
Hibernate Long Session Per Flow? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    It's not a high priority at the moment, but certainly something we're considering. Anyway, the code posted above should get you started with PR5.

    Erwin

    Comment


    • #17
      Hello,

      I have problems when i use the OpenSessionInFlowListner and the OpenSessionInViewInterceptor (to do lazy loading).

      The long session in flow works fine but i've got an error in the interceptor :
      Code:
      java.lang.IllegalStateException: No value for key [net.sf.hibernate.impl.SessionFactoryImpl@70c242] bound to thread [http8080-Processor25]
      	at org.springframework.transaction.support.TransactionSynchronizationManager.unbindResource(TransactionSynchronizationManager.java:175)
      	at org.springframework.orm.hibernate.support.OpenSessionInViewInterceptor.afterCompletion(OpenSessionInViewInterceptor.java:214)
      	at org.springframework.web.servlet.DispatcherServlet.triggerAfterCompletion(DispatcherServlet.java:978)
      	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:720)
      	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:625)
      	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:392)
      	at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:347)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:284)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
      	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:257)
      	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
      	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
      	at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:245)
      	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:199)
      	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
      	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
      	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:195)
      	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
      	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:164)
      	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)
      	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
      	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:156)
      	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
      	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
      	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)
      	at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:206)
      	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:828)
      	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:700)
      	at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:584)
      	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
      	at java.lang.Thread.run(Thread.java:534)
      java.lang.NullPointerException
      	at org.springframework.orm.hibernate.support.OpenSessionInViewInterceptor.postHandle(OpenSessionInViewInterceptor.java:180)
      	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:690)
      	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:625)
      	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:392)
      	at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:347)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:284)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
      	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:257)
      	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
      	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
      	at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:245)
      	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:199)
      	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
      	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
      	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:195)
      	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
      	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:164)
      	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)
      	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
      	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:156)
      	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
      	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
      	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)
      	at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:206)
      	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:828)
      	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:700)
      	at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:584)
      	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
      	at java.lang.Thread.run(Thread.java:534)
      In fact, i try to find a way to have long session per flow and lazy loading

      Comment


      • #18
        In fact the method requestProcessed(..) of OpenSessionInFlowListner close the session opened by the OpenSessionInViewInterceptor...

        Comment


        • #19
          OpenSessionInView interferes with OpenSessionInFlowListener

          Originally posted by Thieumdesp
          In fact the method requestProcessed(..) of OpenSessionInFlowListner close the session opened by the OpenSessionInViewInterceptor...
          Yes. This is an unfortunate consequence of using the OpenSessionInViewInterceptor in tandem with the OpenSessionInFlowListener - the interceptor closes the hibernate session that should remain open from flow request to flow request. One way to avoid this is to use the OpenSessionInViewFilter instead. Using the filter allows to you map execution of the OpenSessionInView logic only to non-webflow urls by creating the appropriate filter-mapping entry in your web.xml file.

          If there seems to be a demand for it, I could write extensions of the OpenSessionInView classes that gracefully avoid terminating sessions opened for flows...

          Comment


          • #20
            I reply in this post (because it's the same subject) :
            http://forum.springframework.org/showthread.php?t=20322

            Comment


            • #21
              Has there been any steps towards integrating OSIF in to the next release of SWF?

              Comment


              • #22
                More Information about OpenSessionInFlowListener

                If your reading this thread for information about the OpenSessionInFlowListener, be sure to head over to this thread for further discussion:

                http://forum.springframework.org/showthread.php?t=20322

                Comment

                Working...
                X