Re: [c3p0-users] Getting SocketTimeoutException: Read timed out in my web application
Status: Beta
Brought to you by:
swaldman
From: Steve W. <swa...@mc...> - 2009-01-12 06:27:47
|
why do you think this is c3p0-related? smiles, Steve On Jan 12, 2009, at 1:11 AM, Kiran Kumar KS wrote: > Hi I am using Tomcat 5.5.27, MySQL 5, REST web Service and Hibernate > 3. > > My controller will collect data from the Agents and stores in the DB. > When I start the GUI(Web application), it sends the request to > webservice(running in Tomcat 5.5.27) and from that to Controller. > Controller takes data from DB and create XML files and sends back > response to GUI thru webservice. > The response time is 90 seconds( for each 90sec xml file in GUI side > will be refreshing). > > This process works fine for some time i.e, depends on the no. of > Agents and JVM's. > ex: Initially GUI (Tomcat 5.5.27 or 5.5.20) was throwing > SocketTimeoutException: Read timed out exception after 45 minutes. > Then I changed the hibernate.cfg file and it works fine more than 48 > hours. After throwing exception also the xml file in GUI side will > refresh , but not exactly for 90 seconds. It will take 2 minutes to > 1 hour. Below I have given the Previous and current hibernate.cfg > files. > Please suggest me where I am doing wrong in the configurations. > > NOTE: There is no exception in Controller , Agent or Web service. > Only GUI (Tomcat) throwing SocketTimeoutException: Read > timed out exception > > Full error details: > > 2008-12-30 09:49:05 (RESTSender.java:279) ERROR > [org.apache.axis2.transport.http > .RESTSender] Error in processing POST request > java.net.SocketTimeoutException: Read timed out > at java.net.SocketInputStream.socketRead0(Native Method) > at java.net.SocketInputStream.read(SocketInputStream.java:129) > at java.io.BufferedInputStream.fill(BufferedInputStream.java: > 218) > at java.io.BufferedInputStream.read(BufferedInputStream.java: > 235) > at > org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java: > 77) > at > org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:105 > ) > at > org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection. > java:1115) > at > org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMetho > dBase.java:1832) > at > org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodB > ase.java:1590) > at > org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.j > ava:995) > at > org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(Htt > pMethodDirector.java:397) > at > org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMe > thodDirector.java:170) > at > org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.jav > a:396) > at > org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.jav > a:346) > at > org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(Abst > ractHTTPSender.java:530) > at > org.apache.axis2.transport.http.RESTSender.sendViaPost(RESTSender.jav > a:251) > at > org.apache.axis2.transport.http.RESTSender.send(RESTSender.java:122) > at > org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessa > geWithCommons(CommonsHTTPTransportSender.java:299) > at > org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(Com > monsHTTPTransportSender.java:207) > at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java: > 589) > at > org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisO > peration.java:328) > at > org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAx > isOperation.java:279) > at > org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java: > 457) > at > org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java: > 399) > at > org.kaizen.eagleeye.gui.eeservice.client.EEServiceClient.callService( > Unknown Source) > at > org.kaizen.eagleeye.gui.timerservice.ScheduledTask.fetchDataFromServi > ce(Unknown Source) > at > org.kaizen.eagleeye.gui.timerservice.ScheduledTask.run(Unknown Source > ) > at java.util.TimerThread.mainLoop(Timer.java:512) > at java.util.TimerThread.run(Timer.java:462) > > > > Previous hibernate.cfg file ( Application works for 45 minutes). > > <hibernate-configuration> > > <session-factory> > > <property name="connection.url"> > jdbc:mysql://localhost/<application_name> > </property> > <property name="connection.username">root</property> > <property name="connection.driver_class"> > com.mysql.jdbc.Driver > </property> > <property name="dialect"> > org.hibernate.dialect.MySQL5Dialect > </property> > <property name="connection.password"></property> > <property name="current_session_context_class">thread</ > property> > <property name="show_sql">false</property> > <property name="transaction.factory_class"> > org.hibernate.transaction.JDBCTransactionFactory > </property> > > <property name="hibernate.c3p0.min_size">10</property> > <property name="hibernate.c3p0.max_size">30</property> > <property name="hibernate.c3p0.timeout">180</property> > <property name="hibernate.c3p0.max_statements">20</property> > > > mapping files................ > > </session-factory> > </hibernate-configuration> > > current hibernate.cfg file > <hibernate-configuration> > > <session-factory> > > <property name="connection.driver_class"> > com.mysql.jdbc.Driver > </property> > <property name="connection.url"> > jdbc:mysql://localhost/<application_name>? > autoReconnect=true > </property> > <property name="connection.username">root</property> > <property name="connection.password"></property> > > <!-- SQL dialect --> > <property name="dialect"> > org.hibernate.dialect.MySQL5Dialect > </property> > > <!-- Enable Hibernate's automatic session context management > --> > <property name="current_session_context_class">thread</ > property> > <!-- Echo all executed SQL to stdout --> > <property name="show_sql">true</property> > <property name="format_sql">false</property> > <property name="order_updates">true</property> > <property name="transaction.factory_class"> > org.hibernate.transaction.JDBCTransactionFactory > </property> > <property name="transaction.flush_before_completion">true</ > property> > <property name="transaction.auto_close_session">true</ > property> > > <!-- Drop and re-create the database schema on startup --> > <property name="hbm2ddl.auto">update</property> > <!-- JDBC connection pool (use the built-in) --> > <property name="connection.pool_size">40</property> > <property > name="hibernate.cglib.use_reflection_optimizer">true</property> > <!-- Disable the second-level cache --> > <property > name="cache.provider_class">org.hibernate.cache.NoCacheProvider</ > property> > <property > name="hibernate.connection.aggressive_release">true</property> > <property > name > = > "connection > .provider_class">org.hibernate.connection.C3P0ConnectionProvider</ > property> > <property name="c3p0.acquire_increment">2</property> > <property name="c3p0.min_size">0</property> > <property name="c3p0.timeout">60</property> > <property name="c3p0.max_size">100</property> > <property name="c3p0.idleConnectionTestPeriod">100</property> > <property name="c3p0.max_statements">20</property> > <property name="c3p0.propertyCycle">2</property> > <property name="c3p0.autoCommitOnClose ">true</property> > <property name="c3p0.numHelperThreads">3</property> > <property name="c3p0.validate">true</property> > <property name="c3p0.acquireRetryAttempts">50</property> > <property name="c3p0.acquireRetryDelay">1000</property> > <property name="c3p0.maxConnectionAge">120</property> > <property > name="c3p0.automaticTestTable">connection_test_table</property> > <property name="c3p0.testConnectionOnCheckout">true</property> > <property name="c3p0.preferredTestQuery">select 1;</property> > <property name="connection.autocommit">true</property> > <property name="connection.shutdown">false</property> > <property name="connection.autoReconnectForPools">true</ > property> > <property name="connection.autoReconnect">true</property> > > mapping files......................... > > </session-factory> > > </hibernate-configuration> > > > > > > -- > With Best Regards, > Anant > ------------------------------------------------------------------------------ > Check out the new SourceForge.net Marketplace. > It is the best place to buy or sell services for > just about anything Open Source. > http://p.sf.net/sfu/Xq1LFB_______________________________________________ > c3p0-users mailing list > c3p...@li... > https://lists.sourceforge.net/lists/listinfo/c3p0-users ~oo~ Steve Waldman swa...@mc... |