JDBC communication link failure after some time

2019-05-31 16:56发布

问题:

I am using JDBC with proxool connection pool to connect to mysql DB. I am selecting large number of rows from multiple threads and after some time i get an error saying communication link failure, Last packet sent to the server was ...ago. I am closing connection,statement,resultSet in every thread. The fetching time increases gradually and the exception occurs after 5-10 minutes. I doubt it is a memory leak, but cant find any clue.

Please let me know the possible reasons.

Thanks, Kaka

回答1:

it may related on your Connection Timeout, try to increase it.

con.setConnectionTimeout(X);