当前位置:   article > 正文

Druid连接池泄露_could not get jdbc connection; nested exception is

could not get jdbc connection; nested exception is com.alibaba.druid.pool.ge

定义

连接池中连接数同一时间被用光 当超过指定时间时 还未等到连接 就会报以上错误

//报错信息
Could not get JDBC Connection; nested exception is com.alibaba.druid.pool.GetConnectionTimeoutException: wait millis 20, active 5, maxActive 20
  • 1
  • 2

排查

开启以下配置 排查异常代码

 # 开启超时自动回收连接
spring.datasource.removeAbandoned=true
# 设置自动回收连接的超时时间  秒
spring.datasource.removeAbandonedTimeout=180 
# 打印回收连接时的错误日志
spring.datasource.logAbandoned=true 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

解决

该异常多出现在事务执行时间过高,多观察关于事务的代码,有关于事务处的代码不亦处理过多的逻辑

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/爱喝兽奶帝天荒/article/detail/976613?site
推荐阅读
相关标签
  

闽ICP备14008679号