We are getting the exception of java.sql.SQLRecoverableException: No more data to read from socket in our application, which is making the connection corrupted. After this, we are not able to fetch any connection from the connection pool and it is displaying the error as Connection closed. Now we are mitigating this issue by restarting the server. We found the root cause of this issue in one area of our application, we are calling a procedure which is calling an external db link and if that external db is down, we get this 'java.sql.SQLRecoverableException: No more data to read from socket` which is an expected behavior.
Here my problem is: As this procedure is calling from only a part of the application, it is affecting the whole connections in the connection pool. Is there a way to handle this exception in that specific part (where this exception is thrown) so that this should not affect the connection pool?
Note: Code for closing the connection is properly implemented in the code.