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.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)

解决方法

  设置defaultStatementTimeout="60"

在sqlmap.xml中设置,表示60s
  sqlMapConfig>

    <settings cacheModelsEnabled="false" enhancementEnabled="true" lazyLoadingEnabled="false" errorTracingEnabled="true" maxRequests="32"

      maxSessions="10" maxTransactions="5" useStatementNamespaces="true" defaultStatementTimeout="60" />

原文地址:https://www.cnblogs.com/lotuses/p/9999808.html

时间: 2024-10-05 04:45:07

MySQL异常:Caused by: com.mysql.jdbc.exceptions.MySQLTimeoutException: Statement cancelled due to timeout or client request的相关文章

Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column &#39;t.statis_date&#39;

1.错误原因 [ERROR:]2015-04-18 13:20:31,883 [异常拦截] com.skycloud.oa.exception.ExceptionHandler org.hibernate.exception.SQLGrammarException: error executing work at org.hibernate.exception.internal.SQLExceptionTypeDelegate.convert(SQLExceptionTypeDelegate.j

Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry &#39;qingmu&#39; for key &#39;PRIMARY&#39;

### Error updating database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry 'qingmu' for key 'PRIMARY' ### The error may involve com.qingmu2.core.dao.seller.SellerDao.insertSelective-Inline ### The

Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL

1.错误描述 org.hibernate.exception.SQLGrammarException: error executing work at org.hibernate.exception.internal.SQLExceptionTypeDelegate.convert(SQLExceptionTypeDelegate.java:80) at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(

Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Query was empty

1 错误描述 at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMe

Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

1.错误描述 [ERROR:]2015-11-05 14:37:52,558 [插入失败] report.service.impl.ReportServiceImpl org.hibernate.exception.JDBCConnectionException: error executing work at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegat

前段时间,接手一个项目使用的是原始的jdbc作为数据库的访问,发布到服务器上在运行了一段时间之后总是会出现无法访问的情况,登录到服务器,查看tomcat日志发现总是报如下的错误。    Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Data source rejected est

前段时间,接手一个项目使用的是原始的jdbc作为数据库的访问,发布到服务器上在运行了一段时间之后总是会出现无法访问的情况,登录到服务器,查看tomcat日志发现总是报如下的错误. Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Data source rejected establishment of connection, message from server: "Too man

Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Result consisted of more than

1.错误描述 at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125) at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66) at org.apache.shiro.web.servlet.AbstractShiroFilter.executeCha

异常解决com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

21:37:08,815 DEBUG BasicResourcePool:1831 - An exception occurred while acquiring a poolable resource. Will retry.com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure The last packet sent successfully to the server was

Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column &#39;org_mer_id&#39; in where clause is ambiguous

### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column 'org_mer_id' in where clause is ambiguous ### The error may exist in class path resource [mapper/StatisticsPeriodTaskMapper.xml] ##