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

    <settings cacheModelsEnabled="false" enhancementEnabled="true"
lazyLoadingEnabled="false" errorTracingEnabled="true" maxRequests="32"
maxSessions="10" maxTransactions="5" useStatementNamespaces="true" defaultStatementTimeout="60" />

链接: http://blog.csdn.net/u014698348/article/details/53409786


 上一篇
java中Integer转Float总结以及BigDecimal 转float java中Integer转Float总结以及BigDecimal 转float
一.先将Integer转化成int类型,在强制转float类型() 例: Integer str = new Integer(20); int i = str.intValue(); float rr = (floa
2019-01-20
下一篇 
关于字符串重复调用转换的优化方法 关于字符串重复调用转换的优化方法
我们通常如果数据库定义的是int类型,但是需求是页面显示的是字符串,如果是多个方法,就需要重复调用,所以为此,我们提供了枚举类型来优化, 例子如下: if(StringUtils.isNotBlank(singleCenter.getSta
2019-01-20
  目录