com.mysql.jdbc.exceptions.MySQLTimeoutException: Statement cancelled due to timeout or client request
Posted by: Vony John
Date: May 08, 2010 04:24AM

Hi,

We have recently upgraded our db server from mysql 5.0 community version to mysql 5.1 community version.

Our new mysql 5.1 db server is running on 64 bit RedHat Enterprise Linux 5, and this db is being accessed by our J2EE web application deployed on jboss application server.

we are using is mysql connector 5.1.12.

Since this upgrade we are seeing one exception every now and then for different-2 list pages in our application.

In these list pages we are fetching data using hibernate and also using hibernate paging, and by default we display 50 records per page.

I was wondering like even in 50 rows mysql JDBC driver is throwing following exception intermittently

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)


We could have set PreparedStatement.setTimeOut, however we are no using plain JDBC, so i am not sure where should i set this statement timeout period.

What is the default statement timeout perdio is set in mysql jdbc driver ?
is there any way i can override it in my application/hibernate code or in mysql config file(my.cnf)

Any help would be gretly appreciated.

Thanks
John

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.