Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure isValid() will not last more than timeout seconds #1557

Merged
merged 5 commits into from Sep 5, 2019

Fix check style

  • Loading branch information...
arobert-delfingen committed Sep 4, 2019
commit 11b1f3f2df2b41a90acd13a3400cbc3b9d5eacd5
@@ -1378,9 +1378,9 @@ public boolean isValid(int timeout) throws SQLException {
if (isClosed()) {
return false;
}
int savedNetworkTimeOut = getNetworkTimeout();
int savedNetworkTimeOut = getNetworkTimeout();
try {
setNetworkTimeout(null, timeout*1000);
setNetworkTimeout(null, timeout * 1000);
if (replicationConnection) {
Statement statement = createStatement();
statement.execute("IDENTIFY_SYSTEM");
@@ -1399,8 +1399,7 @@ public boolean isValid(int timeout) throws SQLException {
return true;
}
LOGGER.log(Level.FINE, GT.tr("Validating connection."), e);
}
finally {
} finally {
setNetworkTimeout(null, savedNetworkTimeOut);
}
return false;
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.