int times, Object... args) throws SQLException {
//�����֧�����ԣ���times��Ϊ1�Ϳ�����
if (!this.isSupportRetry) {
times = 1;
}
WeightRandom wr = this.weightRandom;
List<SQLException> exceptions = new ArrayList<SQLException>(0);
List<String> excludeKeys = new ArrayList<String>(0);
if (failedDataSources != null) {
exceptions.addAll(failedDataSources.values());
times = times - failedDataSources.size(); //�۳��Ѿ�ʧ�ܵ������Դ���
for (SQLException e : failedDataSources.values()) {
if (!exceptionSorter.isExceptionFatal(e)) {
//��һ���쳣����ʵ����������쳣����map��֪��˳��ֻ�ܱ������������ݿⲻ�����쳣�����׳�
//�Dz���Ӧ���ڷ��ַ����ݿ�fatal֮��������׳��������Ƿŵ�failedDataSources���map��?(guangxia)
return tryer.onSQLException(exceptions, exceptionSorter, args);
}
}
}
for (int i = 0; i < times; i++) {
String name = selectAliveKey(wr, excludeKeys);
if (name == null) {
// Ϊ����չ
exceptions.add(new NoMoreDataSourceException("tryTime:" + i + ", excludeKeys:" + excludeKeys
+ ", weightConfig:" + wr.getWeightConfig()));
break;
}
DataSourceHolder dsHolder = dataSourceMap.get(name);
if (dsHolder == null) {