|
|
2
1
我快速查看了源代码,这看起来像ConnectionPool.getConnection的标准行为。这个 documentation 我也这么说。
|
|
|
3
0
您可以使用Thread.sleep()来处理它。 public Connection getConnection() throws SQLException {
Connection conn = null;
while (conn ==null){
try {
conn = DriverManager.getConnection("proxool."+connectionPoolAlias);
} catch (SQLException e) {
e.printStackTrace();
String methodName =e.getStackTrace()[0].getMethodName();
if (methodName.equalsIgnoreCase("checkSimultaneousBuildThrottle") ||
methodName.equalsIgnoreCase("quickRefuse")){
try{
Thread.sleep(500);
}catch( InterruptedException ie){}
}else{
throw e;
}
}
}
return conn;
}
|