Problem:
A Java program which connects to database to extract data from different tables, and after some time of operation, crashes with the stack trace shown below:
[jcc][t4][2030][11211][3.57.82] A communication error occurred during operations on the connection's underlying socket, socket input stream, or socket output stream. Error location: Reply.fill(). Message: Connection reset. ERRORCODE=-4499, SQLSTATE=08001
Resolution:
The problem was fixed once I changed the code to close the connection in final block. I was only closing the statement but not the connection itself. This is reminder of type of problems one might face if doesn't follow the simplest Java & JDBC coding best practices.
No comments:
Post a Comment