相关疑难解决方法(0)

WARN SqlExceptionHelper:143 - SQL错误:0,SQLState:08S01- SqlExceptionHelper:144 - 通信链接失败

我有Hibernate的问题(hibernate-core-4.1.9.Final.jar)

当我在for循环中测试hibernate时工作正常:

for(int i=0;i<1500;i++){

    UserDAO.getInstance.getById(1);
}
Run Code Online (Sandbox Code Playgroud)

当我在for循环中添加Thread.sleep()

 for(int i=0;i<1500;i++){


        UserDAO.getInstance.getById(1);
        Thread.sleep(60000);
 }
Run Code Online (Sandbox Code Playgroud)

1分钟后,我得到例外:

00:20:06,447  WARN SqlExceptionHelper:143 - SQL Error: 0, SQLState: 08S01
00:20:06,448 ERROR SqlExceptionHelper:144 - Communications link failure

The last packet successfully received from the server was 120,017 milliseconds ago.  The last packet sent successfully to the server was 9 milliseconds ago.
Exception in thread "main" org.hibernate.exception.JDBCConnectionException: Communications link failure

The last packet successfully received from the server was 120,017 milliseconds ago.  The last packet …
Run Code Online (Sandbox Code Playgroud)

mysql hibernate

6
推荐指数
1
解决办法
3万
查看次数

标签 统计

hibernate ×1

mysql ×1