mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
当和数据建立连接出错时添加Sleep参数
git-svn-id: http://code.alibabatech.com/svn/druid/trunk@206 b9813039-fb51-4c41-a8b9-e21c2acb5095
This commit is contained in:
@@ -536,6 +536,19 @@ public class DruidDataSource extends DruidAbstractDataSource implements DruidDat
|
||||
break;
|
||||
} catch (SQLException e) {
|
||||
printStackTrace(e);
|
||||
|
||||
if (timeBetweenConnectErrorMillis > 0) {
|
||||
try {
|
||||
Thread.sleep(timeBetweenConnectErrorMillis);
|
||||
} catch (InterruptedException e1) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} catch (RuntimeException e) {
|
||||
printStackTrace(e);
|
||||
} catch (Error e) {
|
||||
printStackTrace(e);
|
||||
break;
|
||||
} finally {
|
||||
lock.unlock();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user