Depends on your datasource... I'm using spring so it's in my spring.xml
-----Original Message----- From: Odelya YomTov [mailto:ode...@jpost.com] Sent: 08 September 2009 02:17 PM To: user-java@ibatis.apache.org Subject: RE: Problem with connecting Hi! To which file would you add it? -----Original Message----- From: meindert [mailto:meind...@eduflex.com] Sent: Tuesday, September 08, 2009 2:52 PM To: user-java@ibatis.apache.org Subject: RE: Problem with connecting I would add the validationQuery to the datasource, not sure if it helps in your case though; That would validate old connections before using them. Here is my datasource setup; <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <property name="driverClassName" value="${database_driver}" /> <property name="url" value="${database_url}" /> <property name="username" value="${database_user}" /> <property name="password" value="${database_password}" /> <property name="defaultAutoCommit" value="true"/> <property name="defaultTransactionIsolation" value="2"/> <property name="maxActive" value="10"/> <property name="removeAbandoned" value="true"/> <property name="removeAbandonedTimeout" value="30"/> <property name="logAbandoned" value="false"/> <property name="validationQuery" value="select 1"/> </bean> -----Original Message----- From: Odelya YomTov [mailto:ode...@jpost.com] Sent: 08 September 2009 10:45 AM To: user-java@ibatis.apache.org Subject: Problem with connecting Hi! Once a day I get the following message: javax.servlet.ServletException: Failed to execute queryForObject - id [getUserByNameAndPassword], parameterObject [il.co.yalkut.data.userd...@4d8d50]. Cause: com.ibatis.common.jdbc.exception.NestedSQLException: --- The error occurred in il/co/yalkut/dbaccess/sql/User.xml. --- The error occurred while applying a parameter map. --- Check the getUserByNameAndPassword-InlineParameterMap. --- Check the statement (query failed). --- Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was42677 milliseconds ago.The last packet sent successfully to the server was 42677 milliseconds ago, which 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. Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was42677 milliseconds ago.The last packet sent successfully to the server was 42677 milliseconds ago, which 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. org.apache.struts.action.RequestProcessor.processException(RequestProcessor. java:523) org.apache.struts.action.RequestProcessor.processActionPerform(RequestProces sor.java:421) org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224) org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194) org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432) I added &autoReconnect=true to the url in database.properties but it doesn't help! What can I do? --------------------------------------------------------------------- To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org For additional commands, e-mail: user-java-h...@ibatis.apache.org No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.409 / Virus Database: 270.13.81/2350 - Release Date: 09/07/09 18:03:00 --------------------------------------------------------------------- To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org For additional commands, e-mail: user-java-h...@ibatis.apache.org **************************************************************************** ******** This footnote confirms that this email message has been scanned by PineApp Mail-SeCure for the presence of malicious code, vandals & computer viruses. **************************************************************************** ******** --------------------------------------------------------------------- To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org For additional commands, e-mail: user-java-h...@ibatis.apache.org No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.409 / Virus Database: 270.13.81/2350 - Release Date: 09/07/09 18:03:00 --------------------------------------------------------------------- To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org For additional commands, e-mail: user-java-h...@ibatis.apache.org