I have used Spring / ibatis. when the server is idle for long time and when there exists a transaction into database the following error is thrown
Apr 13, 2011 10:51:25 AM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [org/springframework/jdbc/support/sql-error-codes.xml]
Apr 13, 2011 10:51:25 AM org.springframework.jdbc.support.SQLErrorCodesFactory <init>
INFO: SQLErrorCodes loaded: [DB2, Derby, H2, HSQL, Informix, MS-SQL, MySQL, Oracle, PostgreSQL, Sybase]
org.springframework.dao.DataAccessResourceFailureException: SqlMapClient operation; SQL [];
--- The error occurred in xxx/xxx/xxx/xxxx/xxxx.xml.
--- The error occurred while applying a parameter map.
--- Check the checkprofile-InlineParameterMap.
--- Check the statement (query failed).
--- Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was 67,890,506 milliseconds ago. The last packet sent successfully to the server was 67,890,506 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in xxx/xxx/xxx/xxxx/xxxx.xml.
--- The error occurred while applying a parameter map.
--- Check the checkprofile-InlineParameterMap.
--- Check the statement (query failed).
--- Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was 67,890,506 milliseconds ago. The last packet sent successfully to the server was 67,890,506 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.
But 2nd transaction with DB was successful . ie. only the first transaction fails when the server is idle for much time.
After research I included the following property in spring-config.xml
But doesnt help to solve my isssue.
Could any one guide me on this issue??? Thanks.