I have a problem with the configuration of the J-Connector plug-in with a MySQL database. Most of the time all works well, but sometimes the connection remains blocked for 2 hours and then it gives this error:
JDBC::error: "Communications link failure\n\nThe last packet successfully received from the server was 7,200,110 milliseconds ago. The last packet sent successfully to the server was 7,200,047 milliseconds ago."
Note: I'm executing the query right after the connection is set, without waiting. It seems that the query is fetching results (with Mathematica running), but instead it remains blocked for 2 hours and then it fails.
Edit: I have noticed that the connection is correctly estabilished, then during the execution of the query it magically disappears (I have seen this checking the
SHOW PROCESSLIST with another connection to database), but the JDBC driver didn't know anything about this and then after 2 hours it gives the error.
It looks like it has a 2 hours timeout (7,200,000 milliseconds) which I didn't set, my question is: how can I set it to a more reasonable time (like 1 minute)? So I can catch the error and re-execute the query without waiting for a long time.
Or, anyway, do you have any other solution to handle MySQL connection problems?