Fix | Changed property verification logic to throw error on invalid value even if its not being used by driver | GitHub issue
@@ -1703,11 +1703,13 @@ public class SQLServerConnection implements ISQLServerConnection {
sPropKey = SQLServerDriverIntProperty.CANCEL_QUERY_TIMEOUT.toString();
int cancelQueryTimeout = SQLServerDriverIntProperty.CANCEL_QUERY_TIMEOUT.getDefaultValue();
- // use cancelQueryTimeout only if queryTimeout is set.
- if (activeConnectionProperties.getProperty(sPropKey) != null && activeConnectionProperties.getProperty(sPropKey).length() > 0 && queryTimeoutSeconds > defaultQueryTimeout) {
+
+ if (activeConnectionProperties.getProperty(sPropKey) != null && activeConnectionProperties.getProperty(sPropKey).length() > 0) {
try {
int n = Integer.parseInt(activeConnectionProperties.getProperty(sPropKey));
if (n >= cancelQueryTimeout) {
+ // use cancelQueryTimeout only if queryTimeout is set.
+ if(queryTimeoutSeconds > defaultQueryTimeout)
cancelQueryTimeoutSeconds = n;
}
else {
