当和数据建立连接出错时添加Sleep参数

git-svn-id: http://code.alibabatech.com/svn/druid/trunk@206 b9813039-fb51-4c41-a8b9-e21c2acb5095
This commit is contained in:
wenshao
2011-05-28 03:26:00 +00:00
parent a12729573d
commit 6e9f57349e
3 changed files with 66 additions and 2 deletions
@@ -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();
}