You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am upgrading Commons DBCP 1.4.0 to 2.1.0 in my web app. I tested HA-JDBC 3.0.4-SNAPSHOT compatibility with DBCP 2 and it works. However, I ran into a configuration issue for two specific properties in DBCP 2: "connectionInitSqls" and "disconnectionSqlCodes". DBCP 2 configuration docs say they are strings representing collections with elements separated by semi-colons, but the getters/setters in BasicDataSource.java are collection objects instead of String.
I reproduced it by using DataSourceDatabase to configure HA-JDBC. I set location "org.apache.commons.dbcp2.BasicDataSource", and I set my properties for HA-JDBC to pass to each instantiated BasicDataSource object. During initialization, CommonDataSourceDatabase.createDataSource() throws a NullPointerException at line 136.
I debugged and found descriptor.getPropertyType() returns List and Set, respectively. Passing either of those values to findEditor() returns NULL on line 134, hence the NPE on line 136.
Everything else in BasicDataSource seems to work with HA-JDBC 3.0.4-SNAPSHOT. DBCP 2.1 relies on Commons Pool 2.4.0, but there is no conflict with HA-JDBC depending on Commons Pool 1.6.0 because of different package names. I am not using these two properties, so this does not block me. I just wanted to report it in case anyone else runs into it using DBCP 2 with HA-JDBC 3.0 and those two properties.
The text was updated successfully, but these errors were encountered:
I am upgrading Commons DBCP 1.4.0 to 2.1.0 in my web app. I tested HA-JDBC 3.0.4-SNAPSHOT compatibility with DBCP 2 and it works. However, I ran into a configuration issue for two specific properties in DBCP 2: "connectionInitSqls" and "disconnectionSqlCodes". DBCP 2 configuration docs say they are strings representing collections with elements separated by semi-colons, but the getters/setters in BasicDataSource.java are collection objects instead of String.
I reproduced it by using DataSourceDatabase to configure HA-JDBC. I set location "org.apache.commons.dbcp2.BasicDataSource", and I set my properties for HA-JDBC to pass to each instantiated BasicDataSource object. During initialization, CommonDataSourceDatabase.createDataSource() throws a NullPointerException at line 136.
I debugged and found descriptor.getPropertyType() returns List and Set, respectively. Passing either of those values to findEditor() returns NULL on line 134, hence the NPE on line 136.
Everything else in BasicDataSource seems to work with HA-JDBC 3.0.4-SNAPSHOT. DBCP 2.1 relies on Commons Pool 2.4.0, but there is no conflict with HA-JDBC depending on Commons Pool 1.6.0 because of different package names. I am not using these two properties, so this does not block me. I just wanted to report it in case anyone else runs into it using DBCP 2 with HA-JDBC 3.0 and those two properties.
The text was updated successfully, but these errors were encountered: