Skip to content

Commit

Permalink
Tolerate JDBC server errors caused by disconnnect.
Browse files Browse the repository at this point in the history
Signed-off-by: John Eberhard <[email protected]>
  • Loading branch information
jeber-ibm committed Dec 31, 2024
1 parent 0c29a26 commit 0ee425e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -610,10 +610,12 @@ boolean handleException(SQLException e) throws SQLException {
int sqlCode = e.getErrorCode();
String sqlState = e.getSQLState();
if (((sqlCode == -99999) &&
((JDError.EXC_COMMUNICATION_LINK_FAILURE.equals(sqlState)) ||
(JDError.EXC_CONNECTION_UNABLE.equals(sqlState))))
((JDError.EXC_COMMUNICATION_LINK_FAILURE.equals(sqlState)) ||
(JDError.EXC_CONNECTION_UNABLE.equals(sqlState))))
|| ( sqlCode == -7061 && should7061Reconnect(e))
|| (sqlCode == -401 && JDError.EXC_SERVER_ERROR.equals(sqlState)) /* also retry for server errors */
) {

// We do not use EXC_CONNECTION_NONE, since that is what is returned
// after the connection has been closed or aborted.
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ public void close ()
throw new ProxyException (ProxyException.CONNECTION_DROPPED,e);
}

// $$ Question for Jim, his new class skipped the above
// two funtions -- input_.close() and output_.close().
// $$ Question, the new class skipped the above
// two functions -- input_.close() and output_.close().
// If a good idea then remove from here as well.
try {
socket_.close ();
Expand Down

0 comments on commit 0ee425e

Please sign in to comment.