-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Communications link failure due to underlying exception
PostPosted: Fri Mar 11, 2005 3:06 am 
Newbie

Joined: Fri Aug 20, 2004 11:48 am
Posts: 7
Hi,

I use hibernate to develop my game user web system. However, it was dead if noone trigger the web system within half day. I assert the (hibernate-session) has already close after (http-session) time out.

It seems to be connecton pool problem. So I have tried to upgrade the latest version of JDBC driver and add the auto-reconnect parameter into the hibernate config file. But the problem was still occured.

I will be grateful if anyone can help me to solve the problem. ^^

Hibernate version: 2.1.6

Mapping documents:
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">

<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">org.gjt.mm.mysql.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/mmgame?autoReconnect=true</property>
<property name="hibernate.connection.pool_size">5</property>
<property name="show_sql">false</property>
<property name="use_outer_join">true</property>
<property name="dialect">net.sf.hibernate.dialect.MySQLDialect</property>
<property name="hibernate.connection.username">mmgame</property>
<property name="hibernate.connection.password"></property>
<property name="connection.autoReconnect">true</property>
<property name="connection.autoReconnectForPools">true</property>
<property name="connection.is-connection-validation-required">true</property>
<!-- Mapping files -->
<mapping resource="CollisionRecord.hbm.xml"/>
<mapping resource="KeyRecord.hbm.xml"/>
<mapping resource="Operator.hbm.xml"/>
<mapping resource="Candidate.hbm.xml"/>
<mapping resource="Player.hbm.xml"/>
<mapping resource="GamePlay.hbm.xml"/>
<mapping resource="GameResultLog.hbm.xml"/>
<mapping resource="Groups.hbm.xml"/>
<mapping resource="InitState.hbm.xml"/>
<mapping resource="Level.hbm.xml"/>
<mapping resource="CandidateType.hbm.xml"/>
<mapping resource="CDR.hbm.xml"/>
<mapping resource="Admin.hbm.xml"/>
<mapping resource="AdminAccessLog.hbm.xml"/>
</session-factory>
</hibernate-configuration>

Full stack trace of any exception that occurs:
com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:

** BEGIN NESTED EXCEPTION **

java.io.EOFException

STACKTRACE:

java.io.EOFException
at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1842)
at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2288)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2784)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1531)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1622)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2376)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2297)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1860)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1705)
at net.sf.hibernate.impl.BatcherImpl.getResultSet(BatcherImpl.java:87)
at net.sf.hibernate.loader.Loader.getResultSet(Loader.java:875)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:269)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:133)
at net.sf.hibernate.loader.Loader.doList(Loader.java:1033)
at net.sf.hibernate.loader.Loader.list(Loader.java:1024)
at net.sf.hibernate.hql.QueryTranslator.list(QueryTranslator.java:854)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1544)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1521)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1513)
at com.webserver.LevelDAO.findLevel(LevelDAO.java:52)
at com.webserver.LevelDAO.viewGameStatus(LevelDAO.java:71)
at com.webserver.UserRequestHandler.viewGameStatus(UserRequestHandler.java:805)
at org.apache.jsp.contentframeChi_jsp._jspService(org.apache.jsp.contentframeChi_jsp:108)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:99)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:325)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
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:825)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:731)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:526)
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 **

net.sf.hibernate.JDBCException: Could not execute query

Name and version of the database you are using:
mysql 4.1
mysql-connector-java-3.1.7-bin.jar
tomcat 5.5.4
jdk 1.5.0


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 11, 2005 4:18 am 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
1- use a connection pool
2- search forum, there might be something special to do on the mysql side

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.