-
Bug
-
Resolution: Not a Bug
-
Major
-
None
-
3.0
-
None
-
False
-
-
False
Consider this:
AgroalDataSource ds = new AgroalDataSource(); ds.setUrl("jdbc:h2:mem:foo"); ds.setDriverClassName("org.h2.jdbcx.JdbcDataSource"); // I want to use XA assert ds.getDriverClassName().equals("org.h2.jdbcx.JdbcDataSource")
This fails, because ds.getDriverClassName() returns "org.h2.Driver" (autodetected from URL).
This is really unexpected, also because I find no way to then get what was actually set as the driver class name.
I found AG-234 and I guess this came from the desire to support a relaxed reflection contract used by the standard Spring Boot DataSourceBuilder class, but I guess a better solution for this exists. Maybe a distinct pair of setXaDriverClassName/getXaDriverClassName could be provided?
At least the Javadoc of getDriverClassName() should clearly state that it's not supposed to return what was specified as setDriverClassName() in case of XA.