I am using JDBC to connect to a MySQL server (no connection pooling I think). In the connection URL I have autoReconnect=true
But my connection still times out. I've even checked conn.isClosed()
and its false. But when I try to use the connection I get the following exception.
com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception: ** BEGIN NESTED EXCEPTION ** java.net.SocketException MESSAGE: Software caused connection abort: socket write error STACKTRACE: java.net.SocketException: Software caused connection abort: socket write error ...
I know in Java 1.6 you can use conn.isValid(0)
to check the connection, but I am using Java 1.5
Is there a way to either ensure it doesn't time out? Or am I going to have to upgrade to Java 1.6?