public static boolean isExceptionIndicativeOfOverload(Exception e){
  return e instanceof MySQLNonTransientConnectionException || e instanceof CommunicationsException || (e instanceof SQLNestedException && e.getCause() instanceof NoSuchElementException);
}

public static boolean isExceptionIndicativeOfOverload ( Exception e ) { return e instanceof MySQLNonTransientConnectionException || e instanceof CommunicationsException || ( e instanceof SQLNestedException && e . getCause ( ) instanceof NoSuchElementException ) ; }
indicates whether an exception is a symptom of mysql being overloaded or slow . typical symptoms are connection pool exhaustion or mysql connection / socket timeouts .
