+
 新版

Druid discard connection问题

Kerwindu 发布于 2014/11/10 16:09
阅读 19K+
收藏 0

@wenshao 你好,想跟你请教个问题:@wenshao 你好,想跟你请教个问题:

我在项目中使用了Druid连接池,版本:1.0.9,数据库:mysql,应用中会出现以下异常:

2014-11-06 22:36:28,537 ERROR [com.alibaba.druid.pool.DruidDataSource] - discard connection
com.mysql.jdbc.CommunicationsException: The last communications with the server was 28816 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.

配置了testWhileIdle=true,validationQuery=SELECT 'x'

timeBetweenEvictionRunsMillis=60000

minEvictableIdleTimeMillis=300000

以下是问题补充:

@祖安斯国一:我是因为mybatis.configuration.default-statement-timeout设置为30秒,sql执行了51秒导致的druid discard  connection。 报错如下: 2020-01-20  16:08:16.428  ERROR  http-nio-10335-exec-8  com.alibaba.druid.pool.DruidDataSource  h (2020/01/21 00:04)
加载中
0
JackFace
JackFace
贴你的配置信息!
0
God也流泪
God也流泪
您好,请问这个问题解决了吗?
0
疯马儿
疯马儿
我也想知道
0
儿歌
儿歌

我也想知道啊。。纠结。

0
逸海倚楼听风雨
逸海倚楼听风雨

不用线程池没发现问题,一用线程池发现了这么多问题。。网上有说手动 session.close(); ,但用的mytatis,也没有使用注解啥的,,怎么手动关闭??

OSCHINA
登录后可查看更多优质内容
返回顶部
顶部