Skip to Content
0
Former Member
Nov 01, 2009 at 03:00 PM

MySQL datasource going down unexpectedly

42 Views

I am having problems maintaining a MySQL datasource connection on my SAP NetWeaver 7.0 installation. I have successfully created the datasource using the Visual Administrator with the mysql-connector-java-5.1.7-bin.jar driver, and I am able to read/write to the database without any issues too. However, I noticed that when the database is idle for quite some time (a few hours), the connection drops unexpectedly when I try to access it again later via JDBC code. The error message displayed is as follows:

The last packet successfully received from the server was190285 milliseconds ago.The last packet sent successfully to the server was 190285 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.

I tried to modify the JDBC URL to configure the autoReconnect property as follows:

jdbc:mysql://localhost:3306/abc?allowReconnect=true

But it just doesn't seem to take effect. Can anybody help me with this? Any help would be greatly appreciated. Thanks!