hibernate+mysql too many connections错误
程序员文章站
2022-05-26 16:56:40
...
hibernate+mysql too many connections异常 问题分析: 使用Hibernate连接MySQL,多次执行查询操作后会出现以下异常(执行查询的次数等于MySQL的max-connection参数的值): Data source rejected establishment of connection, message from server: "Too ma
hibernate+mysql too many connections异常问题分析:
使用Hibernate连接MySQL,多次执行查询操作后会出现以下异常(执行查询的次数等于MySQL的max-connection参数的值):
Data source rejected establishment of connection, message from server: "Too many connections"
org.hibernate.exception.JDBCConnectionException: Cannot open connection
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:74)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
at org.hibernate.jdbc.ConnectionManager.openConnectionCaused by: com.mysql.jdbc.exceptions.MySQLNonTransientConnectionException: Data source rejected establishment of connection, message from server: "Too many connections"
at com.mysql.jdbc.SQLError.createSQLException
?解决方法:
在执行完查询操作后,仅仅调用了session.close();来关闭session,而没有
调用factory.close();来关闭SessionFanctory。
二者都关闭后不再出现上述异常。
推荐阅读
-
Mysql错误:Too many connections的解决方法
-
mysql连接数设置操作方法(Too many connections)
-
mysql "too many connections" 错误 之 mysql解决方法
-
[翻译]:MySQL Error: Too many connections
-
Mysql错误:Too many connections的解决方法
-
mysql连接数设置操作方法(Too many connections)
-
生产问题三:前端显示网络错误,后端日志显示too many connections
-
mysql 提示too many connections的解决方法
-
MySQL too many connections错误的原因及解决
-
mysql出现too many connections错误提示_MySQL