Statement cancelled due to timeout or client request

tomcat日志报错:

org.springframework.dao.QueryTimeoutException:
### Error querying database. Cause: com.mysql.jdbc.exceptions.MySQLTimeoutException: Statement cancelled due to timeout or client request
### The error may exist in file [/var/lib/tomcat8/webapps/ROOT/WEB-INF/classes/mappers/DeviceMapper.xml]
### The error may involve defaultParameterMap
### The error occurred while setting parameters

原因是,MySQL优化器执行计划 使用了错误的索引,导致一条SQL查询语句超时,需要30多秒,所以报错。

解决方法是使用 force index 提示 mysql 选择正确的索引。搞定。

原文地址:https://www.cnblogs.com/digdeep/p/12663881.html

时间: 2024-08-29 15:06:54

Statement cancelled due to timeout or client request的相关文章

MySQL异常:Caused by: com.mysql.jdbc.exceptions.MySQLTimeoutException: 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.mys

Batch containing 1 record(s) expired due to timeout while requesting metadata from brokers

一.异常信息如下: java.util.concurrent.ExecutionException: org.apache.kafka.common.errors.TimeoutException: Batch containing 1 record(s) expired due to timeout while requesting metadata from brokers for user-video-0 at org.apache.kafka.clients.producer.inter

QQ connect client request's parameters are invalid, invalid openid 问题的解决

很多人的这个问题是POST的时候发生,我的也恰好在POST的时候发生.后来我发现可能是因为QQ的这个后端是采用类PHP的语言开发,在动态语言的获取参数时POST参数和GET参数是可以分开读取的,也就是说如果你把openid.access_token这些数据放在URL GET参数里面,采用$_POST这样的接口就无法读取到openid参数,所以导致POST数据时报错说Invalid openid,当然我的采用的开发语言是官方不支持的,所以SDK是个山寨版,所以我对SDK做了自己的修改:把权限验证数

{"ret":100029,"msg":"client request's api name is not existed"}

AFNetworking对Path的定义问题: 如果把这一串:https://graph.qq.com/user/get_user_init 定义成baseURL 那么后面加的任何Path,都会在Path前面加上一个/ 这个跟NSURL有关系,AF的baseURL是用NSURL实现的,NSURL会把你给的字符串拆分成scheme,host,path,query这些东西 然后AF再处理这个NSURL,而NSURL并不仅仅是一个字符串 给 getPath加参数就行了: {"ret":100

a client request body is buffered to a temporary

error: 2018/09/27 11:29:25 [warn] 4677#0: *9932666337 a client request body is buffered to a temporary file /data/apps/openresty//nginx/client_body_temp/0000565910, client: 100.116.251.28, server: driver.lenth.com.cn, request: "POST /api/v1/driver/lo

ES6.3.2 副本失败处理

ES6.3.2 副本失败处理 副本的失败处理对理解ES的数据副本模型很有帮助.在ES6.3.2 index操作源码流程的总结中提到:ES的写操作会先写主分片,然后主分片再将操作同步到副本分片.本文给出ES中的源码片断,分析副本执行操作失败时,ES是如何处理的. 副本执行源码:replicasProxy.performOn实现了副本操作,执行正常结束回调onResponse(),异常回调onFailure() replicasProxy.performOn(shard, replicaReques

jdk并发包ReentrantLock 源码导读

1,ReentrantLock实现了Lock接口,下面是Lock接口.定义了一些Lock的基本操作. 2,ReentrantLock根据在高并发下获取锁的算法分为FairSync和NonfairSync两种.默认为NonfairSync. 3,FairSync和NonfairSync继承了Sync.而Sync是锁的基础控制类.FairSync依然需要检查当前线程是否是等待队列的第一个,NonfairSync则不需要直接从列表中取一个.实际中公平锁吞吐量比非公平锁小很多. 4,Sync通过Abst

AbstractQueuedSynchronizer源码分析

/* * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * * * */ /* * * * * * * Written by Doug Lea with assistance from members of JCP JSR-166 * Expert Group and released to the public domain, as expl

python例子-urllib,urllib2练习题合集.

#!/usr/bin/python #coding:utf-8 import time import urllib import urllib2 from bs4 import BeautifulSoup import re import cookielib def main0(): unix_timenow = int(time.time()) print '当前时间:%d' % unix_timenow timenow = time.strftime('%Y-%m-%d %H:%M:%S',