-
Notifications
You must be signed in to change notification settings - Fork 8.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with druid version after 1.2.11. The last packet successfully received from the server was 10,036 milliseconds ago. The last packet sent successfully to the server was 10,036 milliseconds ago. #5419
Comments
The first methodyou can set connectTimeout and socketTimeout property value with the jdbc url, just like follow :
see https://dev.mysql.com/doc/connector-j/8.1/en/connector-j-connp-props-networking.html but the value must be in 0 - 2147483647, otherwise ,you will seesome exception :
The second method:ou can call setConnectTimeout and setSocketTimeout to -1 ,so no timout forever ,same as before. the demo code is follow:
spring bean config just like follow:
I suggest you use the second method |
@lizongbo, thanks for your help. |
I have an issue when upgrading Druid from version 1.2.11 to 1.2.18. The new version adds socketTimeout in DruidDataSource.java and the default value is 10_000.
I think it is the reason of exception below:
But I think the default socketTimeout of MySQL JDBC is 0 (Timeout, specified in milliseconds, on network socket operations. Value "0" means no timeout).
How can I set socketTimeout in Druid 1.2.18 to no timeout? Please help.
The text was updated successfully, but these errors were encountered: