mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
DruidDataSource support initExceptionThrow config.
This commit is contained in:
@@ -2027,6 +2027,20 @@ public abstract class DruidAbstractDataSource extends WrapperAdapter implements
|
||||
return onFatalError;
|
||||
}
|
||||
|
||||
/**
|
||||
* @ since 1.1.11
|
||||
*/
|
||||
public boolean isInitExceptionThrow() {
|
||||
return initExceptionThrow;
|
||||
}
|
||||
|
||||
/**
|
||||
* @ since 1.1.11
|
||||
*/
|
||||
public void setInitExceptionThrow(boolean initExceptionThrow) {
|
||||
this.initExceptionThrow = initExceptionThrow;
|
||||
}
|
||||
|
||||
public static class PhysicalConnectionInfo {
|
||||
private Connection connection;
|
||||
private long connectStartNanos;
|
||||
|
||||
@@ -887,7 +887,7 @@ public class DruidDataSource extends DruidAbstractDataSource implements DruidDat
|
||||
initedTime = new Date();
|
||||
registerMbean();
|
||||
|
||||
if (connectError != null && poolingCount == 0) {
|
||||
if (connectError != null && poolingCount == 0 && !(initExceptionThrow && !asyncInit)) {
|
||||
throw connectError;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user