mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
fixed MySqlExceptionSorter
This commit is contained in:
@@ -71,15 +71,21 @@ public class MySqlExceptionSorter implements ExceptionSorter {
|
||||
case 1037: // ER_OUTOFMEMORY
|
||||
case 1038: // ER_OUT_OF_SORTMEMORY
|
||||
return true;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (errorCode >= -10000 && errorCode <= -9000) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(e.getMessage())) {
|
||||
final String errorText = e.getMessage().toUpperCase();
|
||||
String message = e.getMessage();
|
||||
if (message != null && message.length() > 0) {
|
||||
final String errorText = message.toUpperCase();
|
||||
|
||||
if (errorCode == 0
|
||||
&& (errorText.indexOf("COMMUNICATIONS LINK FAILURE") > -1 || errorText
|
||||
.indexOf("COULD NOT CREATE CONNECTION") > -1)
|
||||
|| errorText.indexOf("NO DATASOURCE") > -1
|
||||
if ((errorCode == 0 && (errorText.indexOf("COMMUNICATIONS LINK FAILURE") > -1) //
|
||||
|| errorText.indexOf("COULD NOT CREATE CONNECTION") > -1) //
|
||||
|| errorText.indexOf("NO DATASOURCE") > -1 //
|
||||
|| errorText.indexOf("NO ALIVE DATASOURCE") > -1) {
|
||||
return true;
|
||||
}
|
||||
@@ -87,4 +93,10 @@ public class MySqlExceptionSorter implements ExceptionSorter {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configFromProperties(Properties properties) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user