Hi,
Environment:
- BEA weblogic 8.1 SP2,
- Oracle 9,
- Hibernate using application server (AS) datasources,
- Struts encapsulated by BEA,
- Model-View-Controler (MVC) architecture.
Description:
when using hibernate, we face time to time some "
Session is currently disconnected" exception (details of this exception below).
The strange point is that this exception appears time to time. Then, after several unsuccessfull tries, the application usually allows us to go further deeper in the process.
Questions/needs:
[Q1] reason of such deconnection: which layer can cause such deconnections, DB, Application Server, hibernate itself?
[Q2] ways to solve such problem: should we reconnect the session each time before using it?
[Q3] chaotic results: why this exception is thrown time to time, not always, in different places in our code?
Detail of the exception:
Code:
Caused by: net.sf.hibernate.HibernateException: Session is currently disconnected
at net.sf.hibernate.impl.SessionImpl.connection(SessionImpl.java:3143)
at net.sf.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:40)
at net.sf.hibernate.transaction.JDBCTransactionFactory.beginTransaction(JDBCTransactionFactory.java:19)
at net.sf.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:2158)
at pl.com.lukas.k2.customersummary.dao.CsCustomerDao.getUniverse(CsCustomerDao.java:177)
at pl.com.lukas.k2.customeracquisition.SaleController.bdl.BasicDataExtendedBdl.clientDataRetrieval(BasicDataExtendedBdl.java:1041)
at Sale.SaleController.PassCodeDecision(SaleController.jpf:682)
at sun.reflect.GeneratedMethodAccessor775.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.bea.wlw.netui.pageflow.FlowController.invokeActionMethod(FlowController.java:1495)
at com.bea.wlw.netui.pageflow.FlowController.getActionMethodForward(FlowController.java:1430)
at com.bea.wlw.netui.pageflow.FlowController.internalExecute(FlowController.java:761)
at com.bea.wlw.netui.pageflow.PageFlowController.internalExecute(PageFlowController.java:211)
at com.bea.wlw.netui.pageflow.FlowController.execute(FlowController.java:591)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at com.bea.wlw.netui.pageflow.PageFlowRequestProcessor.process(PageFlowRequestProcessor.java:651)
at com.bea.wlw.netui.pageflow.AutoRegisterActionServlet.process(AutoRegisterActionServlet.java:527)
at com.bea.wlw.netui.pageflow.PageFlowActionServlet.process(PageFlowActionServlet.java:152)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:971)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:402)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6354)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3635)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2585)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170