Note that there are some explanatory texts on larger screens.

plurals
  1. POHibernate Session creation exception after server idle
    text
    copied!<p>I am using a simple java application for manipulating the table records from browser. I have used hibernate for making DAO calls. The application works fine on normal usage. However when the application is idle for 1 to 2 days the following exception occurs.</p> <blockquote> <p>Caused by: java.sql.SQLException: IO Error: Connection reset</p> </blockquote> <p>After using c3p0 the dle time extended up to 10 days. But I want the application to be running up all the time.</p> <p>I have been using Linux sever. JDK 1.5. Tomcat server 6.</p> <p>My Hibernate config,</p> <p> jdbc:oracle:thin:@something.com:1789:patentmd oracle.jdbc.driver.OracleDriver</p> <pre><code> &lt;property name="hibernate.connection.username"&gt;something&lt;/property&gt; &lt;property name="hibernate.connection.password"&gt;something&lt;/property&gt; &lt;property name="hibernate.dialect"&gt;org.hibernate.dialect.Oracle10gDialect&lt;/property&gt; &lt;property name="hibernate.show_sql"&gt;true&lt;/property&gt; &lt;!-- &lt;property name="hibernate.current_session_context_class"&gt;thread&lt;/property&gt; --&gt; &lt;property name="c3p0.acquire_increment"&gt;1&lt;/property&gt; &lt;property name="c3p0.idle_test_period"&gt;30&lt;/property&gt; &lt;property name="c3p0.max_size"&gt;5&lt;/property&gt; &lt;property name="c3p0.min_size"&gt;2&lt;/property&gt; &lt;property name="c3p0.max_statements"&gt;5&lt;/property&gt; &lt;property name="c3p0.timeout"&gt;180&lt;/property&gt; &lt;!-- Mapping Resources. One entry should exist for each table --&gt; &lt;mapping resource="com/hibernate/pojo/clientgrp/ClientGroup.hbm.xml"/&gt; &lt;mapping resource="com/hibernate/pojo/applepub/Apple_Pub.hbm.xml"/&gt; &lt;mapping resource="com/hibernate/pojo/prspub/Prs_Pub.hbm.xml"/&gt; &lt;/session-factory&gt; </code></pre> <p>The full stack trace,</p> <pre><code>$$$$$$$$$$ sessionfactory is not null Connection : true Hibernate: select clientgrou0_.MGR_PRS_ID as MGR1_0_, clientgrou0_.MGR_PRS_NAME as MGR2_0_, clientgrou0_.MGR_CLIENT_GROUP as MGR3_0_, clientgrou0_.UPDATE_DT as UPDATE4_0_, clientgrou0_.CREATE_DT as CREATE5_0_, clientgrou0_.DEPT_NM as DEPT6_0_ from CLIENTGROUPS clientgrou0_ ############ ClientGroupDAO.getAll() , hibernate exception org.hibernate.exception.JDBCConnectionException: could not execu te query ClientGroupTableHandler.getAllRecords() $$$$$$$$ exception occured 6org.hibernate.HibernateException: org.hibernate.excepti on.JDBCConnectionException: could not execute query ClientGroupTableHandler.Main() $$$$$$$$ exception occured 1java.lang.Exception: org.hibernate.HibernateException: org.hiber nate.exception.JDBCConnectionException: could not execute query java.lang.Exception: org.hibernate.HibernateException: org.hibernate.exception.JDBCConnectionException: could not execute qu ery at com.web.servlets.ClientGroupTableHandler.getAllRecords(ClientGroupTableHandler.java:294) at com.web.servlets.ClientGroupTableHandler.Main(ClientGroupTableHandler.java:76) at com.web.servlets.ClientGroupTableHandler.doPost(ClientGroupTableHandler.java:56) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) 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.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:619) Caused by: org.hibernate.HibernateException: org.hibernate.exception.JDBCConnectionException: could not execute query at com.hibernate.dao.ClientGroupDAO.getAll(ClientGroupDAO.java:76) at com.web.servlets.ClientGroupTableHandler.getAllRecords(ClientGroupTableHandler.java:288) ... 16 more Caused by: org.hibernate.exception.JDBCConnectionException: could not execute query at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:99) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) at org.hibernate.loader.Loader.doList(Loader.java:2536) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2276) at org.hibernate.loader.Loader.list(Loader.java:2271) at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:452) at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:363) at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1268) at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102) at com.hibernate.dao.ClientGroupDAO.getAll(ClientGroupDAO.java:45) ... 17 more Caused by: java.sql.SQLException: IO Error: Connection reset at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:876) at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1153) at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1275) at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3576) at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3620) at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1203) at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:208) at org.hibernate.loader.Loader.getResultSet(Loader.java:1953) at org.hibernate.loader.Loader.doQuery(Loader.java:802) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274) at org.hibernate.loader.Loader.doList(Loader.java:2533) ... 25 more Caused by: java.net.SocketException: Connection reset at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:96) at java.net.SocketOutputStream.write(SocketOutputStream.java:136) at oracle.net.ns.DataPacket.send(DataPacket.java:199) at oracle.net.ns.NetOutputStream.flush(NetOutputStream.java:211) at oracle.net.ns.NetInputStream.getNextPacket(NetInputStream.java:227) at oracle.net.ns.NetInputStream.read(NetInputStream.java:175) at oracle.net.ns.NetInputStream.read(NetInputStream.java:100) at oracle.net.ns.NetInputStream.read(NetInputStream.java:85) at oracle.jdbc.driver.T4CSocketInputStreamWrapper.readNextPacket(T4CSocketInputStreamWrapper.java:123) at oracle.jdbc.driver.T4CSocketInputStreamWrapper.read(T4CSocketInputStreamWrapper.java:79) at oracle.jdbc.driver.T4CMAREngine.unmarshalUB1(T4CMAREngine.java:1122) at oracle.jdbc.driver.T4CMAREngine.unmarshalSB1(T4CMAREngine.java:1099) at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:288) at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:191) at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:523) at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:207) at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:863) ... 35 more </code></pre> <blockquote> <p>Blockquote</p> </blockquote>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload