Statement cancelled due to timeout or client request 异常的修复【已解决】
Statement cancelled due to timeout or client request
- 报错详情
- 报错分析及解决
- 问题重现及解决方案
报错详情
Caused by: com.mysql.jdbc.exceptions.MySQLTimeoutException: Statement cancelled due to timeout or client request
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2303)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2696)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2105)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2398)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2316)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2301)
at org.jboss.resource.adapter.jdbc.CachedPreparedStatement.executeUpdate(CachedPreparedStatement.java:95)
at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeUpdate(WrappedPreparedStatement.java:251)
报错分析及解决
在连接数据量比较大的表的时候,可能会报Statement cancelled due to timeout or client request 异常,在JDBC连接参数里加上queryTimeout=2400即可解决。
&queryTimeout=2400
问题重现及解决方案
上述方案治标不治本,所以Statement cancelled due to timeout or client request 卷土重来了
再加入上述参数过后,在数据量达到30w的时候selectByExample 又报这个错误,再经过分析,可能是:sql执行慢导致的阻塞,进而导致其他sql无法执行。
解决方案:
- 配置jdbc超时时间,适当增大
- 加索引,优化SQL,给关联字段增加索引
- 子查询尽量缩小搜索范围,减少join的次数
- 能用join就不要in了
- 限制索引的数目
- 不要查询*(所有),避免大字段,查询需要信息即可
Statement cancelled due to timeout or client request 异常的修复【已解决】相关推荐
- pip install 时报错 ERROR: Could not install packages due to an EnvironmentError: [WinError 5] 拒绝访问(已解决)
pip install 时报错 ERROR: Could not install packages due to an EnvironmentError: [WinError 5] 拒绝访问(已解决) ...
- cx_Oracle.DatabaseError: DPI-1072: the Oracle Client library version is unsupported 已解决
python3在使用cx_Oracle的时候报错了,并且是一致都好好的,突然就报错. Traceback (most recent call last):File "D:/python/wo ...
- 【已解决】(uni-app)IOS 端 H5 应用无法发起请求,请求状态码为0,错误描述为request:fail
[已解决](uni-app)IOS 端 H5 应用无法发起请求,请求状态码为0,错误描述为request:fail 目录 [已解决](uni-app)IOS 端 H5 应用无法发起请求,请求状态码为0 ...
- oracle ipc message,【案例】Oracle RAC IPC send timeout error导致RAC的节点挂起解决办法
天萃荷净 Oracle研究中心案例分析:运维DBA反映Oracle RAC环境数据库节点挂起,分享日志发现是由于IPC send timeout error导致RAC的节点挂起. 本站文章除注明转载外 ...
- HttpClient连接池抛出大量ConnectionPoolTimeoutException: Timeout waiting for connection异常排查...
今天解决了一个HttpClient的异常,汗啊,一个HttpClient使用稍有不慎都会是毁灭级别的啊. 这里有之前因为route配置不当导致服务器异常的一个处理:http://blog.csdn.n ...
- Navicat 远程连接docker容器中的mysql 报错1251 - Client does not support authentication protocol 解决办法
Navicat 远程连接docker容器中的mysql 报错1251 - Client does not support authentication protocol 解决办法 1).容器中登录my ...
- apache AH01630: client denied by server configuration错误解决方法
apache AH01630: client denied by server configuration错误解决方法 出现这个错误的原因是,apache2.4 与 apache2.2 的虚拟主机配置 ...
- HttpClient连接池抛出大量ConnectionPoolTimeoutException: Timeout waiting for connection异常排查
HttpClient连接池抛出大量ConnectionPoolTimeoutException: Timeout waiting for connection异常排查 参考文章: (1)HttpCli ...
- VMware Horizon Client剪贴板异常问题解决
VMware Horizon Client剪贴板异常问题解决 参考文章: (1)VMware Horizon Client剪贴板异常问题解决 (2)https://www.cnblogs.com/in ...
- 使用nginx做反代时遇到413 Request Entity Too Large的解决方法
使用nginx做反代时遇到413 Request Entity Too Large的解决方法 参考文章: (1)使用nginx做反代时遇到413 Request Entity Too Large的解决 ...
最新文章
- css3替代图片的尖角圆角效果
- 自学python系列10:python的函数和函数式编程
- 025_jdbc-mysql-Statement的sql注入问题
- 2 0 2 0 年 第 十 一 届 蓝 桥 杯 - 国赛 - CC++大学B组 - A.美丽的2
- 【struts2】struts2的零配置
- 【最详细的分析】1061 Dating (20 分)
- Spring XSD validation cache issue
- 在生产中运行Java:SRE的观点
- 对上拉下拉电阻的作用作个总结(想了解的过来看看)(转载)
- 【剑指offer】面试题34:二叉树中和为某一值的路径
- Faster RCNN 学习笔记
- curl模拟自动登陆采集网页数据
- pip更新导致ImportError: cannot import name ‘InvalidSchemeCombination‘ from ‘pip._internal.exceptions‘
- matlab均值滤波实现
- 后摩尔时代下先进封装技术
- Windows 下安装FastDFS客户端fdfs-client-py
- 第八届“中国软件杯”大学生软件设计大赛总决赛落幕
- 修复百度编辑器插入视频的bug,可实时预览视频,可修改到支持手机查看视频...
- linux connect自动重连,Linux 北大网关断网重连
- 消费心理学(04):价格锚点