My client gets an error each morning “Cannot load form data”. I looked in the server log and there is an error that the database has timed out.
I see a variety of discussions (autoreconnect, disable timeouts, etc), but I’m not sure of best practices on this. How do I configure Servoy/Mysql so I can leave the server running indefinitely and not get timeouts overnight when the server sits idle?
I have a running a solution on Win2000/Java6, against MySQL 5.0, with the latest JDBC drivers from MySQL.
I’ve experimented with a few different configurations over the last year. For a while a used “query validation” with a “SELECT 1” query. This worked reliably, but was slow. Currently, I have the MySQL dataproviders configured with “exception validation” and added the following to my “my.ini” file:
Thanks Greg. I’ll try the latter, as you’re currently using. I set my timeouts to 300000. Hopefully that won’t be an issue. Sure would be nice to find a long term solution that doesn’t require these timeouts.
I get this message when I start a client from developer after being idle for a long time:
The last packet successfully received from the server was 42,596,750 milliseconds ago. The last packet sent successfully to the server was 42,596,750 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.
I like the sound of ‘autoReconnect = true’. Where do I change this setting? Can anyone confirm that this solves the problem or do I have to play with timeouts in my.ini?
amcgilly:
I like the sound of ‘autoReconnect = true’. Where do I change this setting? Can anyone confirm that this solves the problem or do I have to play with timeouts in my.ini?
You can also set the validation type of the server definition in Servoy to ‘query validation’.
Then add a simple query in the Validation Query field (something like ‘select 1’).
This should allow better reconnect when a connection is retrieved from the pool after 8 hours of inactivity.