Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 85453 invoked from network); 29 Jan 2007 16:10:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 29 Jan 2007 16:10:45 -0000 Received: (qmail 12713 invoked by uid 500); 29 Jan 2007 16:10:00 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 12690 invoked by uid 500); 29 Jan 2007 16:10:00 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 12673 invoked by uid 99); 29 Jan 2007 16:10:00 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Jan 2007 08:10:00 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of luiz.siqueira.neto@gmail.com designates 66.249.82.236 as permitted sender) Received: from [66.249.82.236] (HELO wx-out-0506.google.com) (66.249.82.236) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Jan 2007 08:09:51 -0800 Received: by wx-out-0506.google.com with SMTP id i26so1556103wxd for ; Mon, 29 Jan 2007 08:09:31 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=WVtJ//uwxbEw/rpeMsLev/PFq5ZYIWFP3DKZzevcbHA6WBl4YvO75hfocrZNLD84IETiYxbO6tAul4ns5HjznompusibtK8GI+bvEVTloN88y5YcvY5tEf/rE/2/N1AZoJzNFDmm3gxnhc3ENBFyclruL2p/fg+1DnG9a93q5UE= Received: by 10.70.40.1 with SMTP id n1mr13328341wxn.1170086970974; Mon, 29 Jan 2007 08:09:30 -0800 (PST) Received: by 10.70.34.19 with HTTP; Mon, 29 Jan 2007 08:09:30 -0800 (PST) Message-ID: Date: Mon, 29 Jan 2007 14:09:30 -0200 From: "Luiz Siqueira" To: "Tomcat Users List" Subject: Re: Tomcat and MySQL sync problems In-Reply-To: <45BE1B4E.1020803@cornell.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <9D4120DD4526B2408A45885E1C1575AD9611DC@exchange3.ilevy.com> <45BE1B4E.1020803@cornell.edu> X-Virus-Checked: Checked by ClamAV on apache.org Sorry about this message but I'm a little despaired. I create a JAR library with the business logic, I use Hibernate and MySQL. Everything work fine but when I try use the JAR from a WebApp using the bundled TomCat on NetBeans 5.5 I got an server error. I believe that the problem is that the server don't know about Hibernate and the MySQL drive. I don't know well Tomcat and need know what to do, maybe some one can help me. 2007/1/29, David Smith : > It appears your code is holding on to a connection to the database. Bad > design practice. Review your code for any place that might keep hold of > a connection between requests and make sure the connection is closed. > > Also, If you haven't done so yet, use a database connection pool. If > using tomcat's built-in one, set testOnBorrow to "true" and set > validationQuery to something simple like "select 1". The idea being > that the connections will be validated just before they are borrowed and > used, closed and recreated if they fail. > > Lastly, please avoid autoReconnect=true in the connection url as the > first query will still error out. There is documentation on mysql's > site recommending this option not be used. > > --David > > Scott Purcell wrote: > > >If I remember correctly, MySQL basically disconnects and shutdowns after > >a certain amount of time. I remember doing something with a > >"reload="true" in the datasource to prevent this. > > > >Hopefully someone else may clue you in better, but you may want to check > >the datasource props and see if this is valid. > > > > > >Scott > > > >-----Original Message----- > >From: Chris Long [mailto:chlong2@gmail.com] > >Sent: Monday, January 29, 2007 8:54 AM > >To: users@tomcat.apache.org > >Subject: Tomcat and MySQL sync problems > > > >Hello, > > > >I'm having a problem where it seems Tomcat and MySQL go out of sync and > >I am > >no longer able to connect to the MySQL database. The only way I've > >found to > >be able to reconnect to my database is to restart Tomcat. This > >generally > >seems to happen some time over the course of the night and I notice the > >problem when I check on things in the morning, but it doesn't seem to > >happen > >every time. > > > >Does anyone have any idea what may be causing this and how to fix it? > > > >Here is a list of what I'm using: > > > >Tomcat 5.5.17 > >MySQL 14.12 > >Hibernate 3.2 > >mysql-connector-java-5.0.4 > >JAVA 1.5 > >Windows XP Pro > > > > > >[Jan 29 2007 (Mon)9:30:56 EST] ERROR [http-8888-Processor20]( > >org.hibernate.util.JDBCExceptionReporter) - No operations allowed after > >connection closed.Connection was implicitly closed due to underlying > >exception/error: > > > > > >** BEGIN NESTED EXCEPTION ** > > > >com.mysql.jdbc.CommunicationsException > >MESSAGE: Communications link failure due to underlying exception: > > > >** BEGIN NESTED EXCEPTION ** > > > >java.net.SocketException > >MESSAGE: Software caused connection abort: socket write error > > > >STACKTRACE: > > > >java.net.SocketException: Software caused connection abort: socket write > >error > > at java.net.SocketOutputStream.socketWrite0(Native Method) > > at > >java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92) > > at java.net.SocketOutputStream.write(SocketOutputStream.java:136) > > at > >java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java > >:65) > > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123) > > at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:2637) > > at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1554) > > at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665) > > at com.mysql.jdbc.Connection.execSQL(Connection.java:3176) > > at com.mysql.jdbc.PreparedStatement.executeInternal( > >PreparedStatement.java:1153) > > at > >com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java > >:1266) > > at > >org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java > >:186) > > at org.hibernate.loader.Loader.getResultSet(Loader.java:1778) > > at org.hibernate.loader.Loader.doQuery(Loader.java:662) > > at > >org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections( > >Loader.java:224) > > at org.hibernate.loader.Loader.doList(Loader.java:2211) > > at > >org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2095) > > at org.hibernate.loader.Loader.list(Loader.java:2090) > > at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:388) > > at org.hibernate.hql.ast.QueryTranslatorImpl.list( > >QueryTranslatorImpl.java:338) > > at > >org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java > >:172) > > at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121) > > at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79) > > at org.hibernate.impl.AbstractQueryImpl.uniqueResult( > >AbstractQueryImpl.java:804) > > at > >com.tne.nres.projectTracker.ProjectTrackerServlet.validateUser(Unknown > >Source) > > at com.tne.nres.projectTracker.ProjectTrackerServlet.doPost(Unknown > >Source) > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:709) > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) > > at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( > >ApplicationFilterChain.java:252) > > at org.apache.catalina.core.ApplicationFilterChain.doFilter( > >ApplicationFilterChain.java:173) > > at org.apache.catalina.core.StandardWrapperValve.invoke( > >StandardWrapperValve.java:213) > > at org.apache.catalina.core.StandardContextValve.invoke( > >StandardContextValve.java:178) > > at org.apache.catalina.core.StandardHostValve.invoke( > >StandardHostValve.java:126) > > at org.apache.catalina.valves.ErrorReportValve.invoke( > >ErrorReportValve.java:105) > > at org.apache.catalina.core.StandardEngineValve.invoke( > >StandardEngineValve.java:107) > > at org.apache.catalina.connector.CoyoteAdapter.service( > >CoyoteAdapter.java:148) > > at > >org.apache.coyote.http11.Http11Processor.process(Http11Processor.java > >:869) > > at > >org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.proc > >essConnection > >(Http11BaseProtocol.java:664) > > at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket( > >PoolTcpEndpoint.java:527) > > at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt( > >LeaderFollowerWorkerThread.java:80) > > at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run( > >ThreadPool.java:684) > > at java.lang.Thread.run(Thread.java:595) > > > > > >** END NESTED EXCEPTION ** > > > > > > > >Last packet sent to the server was 16 ms ago. > > > >STACKTRACE: > > > >com.mysql.jdbc.CommunicationsException: Communications link failure due > >to > >underlying exception: > > > >** BEGIN NESTED EXCEPTION ** > > > >java.net.SocketException > >MESSAGE: Software caused connection abort: socket write error > > > >STACKTRACE: > > > >java.net.SocketException: Software caused connection abort: socket write > >error > > at java.net.SocketOutputStream.socketWrite0(Native Method) > > at > >java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92) > > at java.net.SocketOutputStream.write(SocketOutputStream.java:136) > > at > >java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java > >:65) > > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123) > > at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:2637) > > at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1554) > > at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665) > > at com.mysql.jdbc.Connection.execSQL(Connection.java:3176) > > at com.mysql.jdbc.PreparedStatement.executeInternal( > >PreparedStatement.java:1153) > > at > >com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java > >:1266) > > at > >org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java > >:186) > > at org.hibernate.loader.Loader.getResultSet(Loader.java:1778) > > at org.hibernate.loader.Loader.doQuery(Loader.java:662) > > at > >org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections( > >Loader.java:224) > > at org.hibernate.loader.Loader.doList(Loader.java:2211) > > at > >org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2095) > > at org.hibernate.loader.Loader.list(Loader.java:2090) > > at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:388) > > at org.hibernate.hql.ast.QueryTranslatorImpl.list( > >QueryTranslatorImpl.java:338) > > at > >org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java > >:172) > > at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121) > > at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79) > > at org.hibernate.impl.AbstractQueryImpl.uniqueResult( > >AbstractQueryImpl.java:804) > > at > >com.tne.nres.projectTracker.ProjectTrackerServlet.validateUser(Unknown > >Source) > > at com.tne.nres.projectTracker.ProjectTrackerServlet.doPost(Unknown > >Source) > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:709) > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) > > at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( > >ApplicationFilterChain.java:252) > > at org.apache.catalina.core.ApplicationFilterChain.doFilter( > >ApplicationFilterChain.java:173) > > at org.apache.catalina.core.StandardWrapperValve.invoke( > >StandardWrapperValve.java:213) > > at org.apache.catalina.core.StandardContextValve.invoke( > >StandardContextValve.java:178) > > at org.apache.catalina.core.StandardHostValve.invoke( > >StandardHostValve.java:126) > > at org.apache.catalina.valves.ErrorReportValve.invoke( > >ErrorReportValve.java:105) > > at org.apache.catalina.core.StandardEngineValve.invoke( > >StandardEngineValve.java:107) > > at org.apache.catalina.connector.CoyoteAdapter.service( > >CoyoteAdapter.java:148) > > at > >org.apache.coyote.http11.Http11Processor.process(Http11Processor.java > >:869) > > at > >org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.proc > >essConnection > >(Http11BaseProtocol.java:664) > > at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket( > >PoolTcpEndpoint.java:527) > > at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt( > >LeaderFollowerWorkerThread.java:80) > > at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run( > >ThreadPool.java:684) > > at java.lang.Thread.run(Thread.java:595) > > > > > >** END NESTED EXCEPTION ** > > > > > > > >Last packet sent to the server was 16 ms ago. > > at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:2652) > > at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1554) > > at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665) > > at com.mysql.jdbc.Connection.execSQL(Connection.java:3176) > > at com.mysql.jdbc.PreparedStatement.executeInternal( > >PreparedStatement.java:1153) > > at > >com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java > >:1266) > > at > >org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java > >:186) > > at org.hibernate.loader.Loader.getResultSet(Loader.java:1778) > > at org.hibernate.loader.Loader.doQuery(Loader.java:662) > > at > >org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections( > >Loader.java:224) > > at org.hibernate.loader.Loader.doList(Loader.java:2211) > > at > >org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2095) > > at org.hibernate.loader.Loader.list(Loader.java:2090) > > at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:388) > > at org.hibernate.hql.ast.QueryTranslatorImpl.list( > >QueryTranslatorImpl.java:338) > > at > >org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java > >:172) > > at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121) > > at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79) > > at org.hibernate.impl.AbstractQueryImpl.uniqueResult( > >AbstractQueryImpl.java:804) > > at > >com.tne.nres.projectTracker.ProjectTrackerServlet.validateUser(Unknown > >Source) > > at com.tne.nres.projectTracker.ProjectTrackerServlet.doPost(Unknown > >Source) > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:709) > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) > > at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( > >ApplicationFilterChain.java:252) > > at org.apache.catalina.core.ApplicationFilterChain.doFilter( > >ApplicationFilterChain.java:173) > > at org.apache.catalina.core.StandardWrapperValve.invoke( > >StandardWrapperValve.java:213) > > at org.apache.catalina.core.StandardContextValve.invoke( > >StandardContextValve.java:178) > > at org.apache.catalina.core.StandardHostValve.invoke( > >StandardHostValve.java:126) > > at org.apache.catalina.valves.ErrorReportValve.invoke( > >ErrorReportValve.java:105) > > at org.apache.catalina.core.StandardEngineValve.invoke( > >StandardEngineValve.java:107) > > at org.apache.catalina.connector.CoyoteAdapter.service( > >CoyoteAdapter.java:148) > > at > >org.apache.coyote.http11.Http11Processor.process(Http11Processor.java > >:869) > > at > >org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.proc > >essConnection > >(Http11BaseProtocol.java:664) > > at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket( > >PoolTcpEndpoint.java:527) > > at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt( > >LeaderFollowerWorkerThread.java:80) > > at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run( > >ThreadPool.java:684) > > at java.lang.Thread.run(Thread.java:595) > > > > > >** END NESTED EXCEPTION ** > > > >Thanks, > > > >Christopher Long > > > >--------------------------------------------------------------------- > >To start a new topic, e-mail: users@tomcat.apache.org > >To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org > >For additional commands, e-mail: users-help@tomcat.apache.org > > > > > > > > > --------------------------------------------------------------------- > To start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org > For additional commands, e-mail: users-help@tomcat.apache.org > > --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org