Before this commit, exceptionOverrideClass may be loaded by different ClassLoader, and two instances are created but only the latter one is used. This commit make sure the class will only loaded once and only one instance is created.
Fix GH-2124
Fix GH-2171
@ -80,6 +80,7 @@ public class HikariConfig implements HikariConfigMXBean
privateStringdataSourceJndiName;
privateStringdataSourceJndiName;
privateStringdriverClassName;
privateStringdriverClassName;
privateStringexceptionOverrideClassName;
privateStringexceptionOverrideClassName;
privateSQLExceptionOverrideexceptionOverride;
privateStringjdbcUrl;
privateStringjdbcUrl;
privateStringpoolName;
privateStringpoolName;
privateStringschema;
privateStringschema;
@ -913,8 +914,12 @@ public class HikariConfig implements HikariConfigMXBean
thrownewRuntimeException("Failed to load SQLExceptionOverride class "+exceptionOverrideClassName+" in either of HikariConfig class loader or Thread context classloader");
thrownewRuntimeException("Failed to load SQLExceptionOverride class "+exceptionOverrideClassName+" in either of HikariConfig class loader or Thread context classloader");