当前位置: 代码迷 >> Java Web开发 >> hibernate连接mysql数据库有关问题,求大神指教
  详细解决方案

hibernate连接mysql数据库有关问题,求大神指教

热度:100   发布时间:2016-04-16 22:20:18.0
hibernate连接mysql数据库问题,求大神指教
网上下了个项目SSH的,其中部分模块能正常访问,但其中一两个模块访问时会出现错误could not execute query,不能够访问,mysql服务会自动关掉。只能自己手动再开启服务,但每次访问那个模块都出现这样的问题

** END NESTED EXCEPTION **



Last packet sent to the server was 3 ms ago.
23:21:48,974 ERROR DBPool:242 - Unexpected exception whilst calling rollback during connection reset
java.sql.SQLException: 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: Connection reset by peer: socket write error

STACKTRACE:

java.net.SocketException: Connection reset by peer: socket write error
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)

at java.lang.Thread.run(Thread.java:619)
23:21:48,998  WARN DBPool:292 - #1 - There were some problems resetting the connection (see debug output for details). It will not be used again (just in case). The thread that is responsible is named 'http-8080-2'
23:21:48,999  WARN DBPool:295 - #1 - The connection was closed with autoCommit=false. That is fine, but it might indicate that the problems that happened whilst trying to reset it were because a transaction is still in progress.
23:21:49,000  WARN DBPool:356 - Unable to set status of connection 1 from ACTIVEto AVAILABLE. It remains NULL
23:21:49,058 DEBUG SystemExceptionHandler:41 - 出现异常
org.hibernate.exception.JDBCConnectionException: could not execute query
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:74)

------解决方案--------------------
做的是什么操作呢?猜测还是跟你的业务和数据库设置有关
------解决方案--------------------
看看数据库配置,连接池
日志调 debug
------解决方案--------------------
看看是不是数据库有毛病了,在别的机器安装一个看看
  相关解决方案