从服务器成功收到的最后一个数据包是45915秒前

时间:2014-10-08 07:29:48

标签: mysql hibernate

网站正在客户端的服务器上运行,我们得到以下例外......

com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was 45915 seconds ago.The last packet sent successfully to the server was 45915 seconds ago, which is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem. 
at sun.reflect.GeneratedConstructorAccessor268.newInstance(Unknown Source) 
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) 
at java.lang.reflect.Constructor.newInstance(Constructor.java:526) 
at com.mysql.jdbc.Util.handleNewInstance(Util.java:406) 
at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1074) 
at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3246) 
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1917) 
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2060) 
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2542) 
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1734) 
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1885) 
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:186) 
at org.hibernate.loader.Loader.getResultSet(Loader.java:1787) 
at org.hibernate.loader.Loader.doQuery(Loader.java:674) 
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236) 
at org.hibernate.loader.Loader.doList(Loader.java:2220) 
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104) 
at org.hibernate.loader.Loader.list(Loader.java:2099) 
at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:94) 
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1569) 
at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:283) 
at org.hibernate.impl.CriteriaImpl.uniqueResult(CriteriaImpl.java:305)
......... 

我的问题是JDBC驱动程序如何决定秒45915? MySQL服务器中是否存在用于连接特定数据库的变量?如何获取与MySQL建立的最新连接的详细信息以及与连接相关的其他信息。

0 个答案:

没有答案