mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
Merge pull request #1172 from wenshao/master
discard mysql streaming resultSet close error connection
This commit is contained in:
@@ -68,6 +68,11 @@ public class MySqlExceptionSorter implements ExceptionSorter {
|
||||
|
||||
String message = e.getMessage();
|
||||
if (message != null && message.length() > 0) {
|
||||
if (message.startsWith("Streaming result set com.mysql.jdbc.RowDataDynamic")
|
||||
&& message.endsWith("is still active. No statements may be issued when any streaming result sets are open and in use on a given connection. Ensure that you have called .close() on any active streaming result sets before attempting more queries.")) {
|
||||
return true;
|
||||
}
|
||||
|
||||
final String errorText = message.toUpperCase();
|
||||
|
||||
if ((errorCode == 0 && (errorText.contains("COMMUNICATIONS LINK FAILURE")) //
|
||||
@@ -78,15 +83,6 @@ public class MySqlExceptionSorter implements ExceptionSorter {
|
||||
}
|
||||
}
|
||||
|
||||
StackTraceElement[] stackTrace = e.getStackTrace();
|
||||
for (int i = 0; i < stackTrace.length; ++i) {
|
||||
StackTraceElement element = stackTrace[i];
|
||||
if ("com.mysql.jdbc.RowDataDynamic".equals(element.getClassName()) //
|
||||
&& "close".equals(element.getMethodName())
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user