Skip to content

Commit 0296179

Browse files
committed
Added back changes for connection part of CRL, which only affect existing files. To allow for PR to be created.
1 parent 3be298f commit 0296179

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnection.java

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2002,10 +2002,23 @@ Connection connect(Properties propsIn, SQLServerPooledConnection pooledConnectio
20022002
}
20032003
throw e;
20042004
} else {
2005-
// only retry if transient error
2005+
// Only retry if matches configured CRL rules, or transient error (if CRL is not in use)
20062006
SQLServerError sqlServerError = e.getSQLServerError();
2007-
if (!TransientError.isTransientError(sqlServerError)) {
2007+
if (null == sqlServerError) {
20082008
throw e;
2009+
} else {
2010+
ConfigRetryRule rule = ConfigurableRetryLogic.getInstance()
2011+
.searchRuleSet(sqlServerError.getErrorNumber(), "connection");
2012+
2013+
if (null == rule) {
2014+
if (ConfigurableRetryLogic.getInstance().getReplaceFlag()) {
2015+
throw e;
2016+
} else {
2017+
if (!TransientError.isTransientError(sqlServerError)) {
2018+
throw e;
2019+
}
2020+
}
2021+
}
20092022
}
20102023

20112024
// check if there's time to retry, no point to wait if no time left

0 commit comments

Comments
 (0)