Created attachment 950974 [details] module.xml Description of problem: In a multiple JDBC modules setup (2 different versions of Oracle driver), wrong driver version is picked Version-Release number of selected component (if applicable): How reproducible: Modules have been created manually (see oracle.zip, attached, with module.xml) Then drivers are added like follows: /profile=full/subsystem=datasources/jdbc-driver=oracle:add(driver-name=oracle,driver-module-name=oracle.jdbc,driver-xa-datasource-class-name=oracle.jdbc.xa.client.OracleXADataSource) /profile=full/subsystem=datasources/jdbc-driver=oracle11.1:add(driver-name=oracle11.1,driver-module-name=oracle.jdbc,driver-xa-datasource-class-name=oracle.jdbc.xa.client.OracleXADataSource,module-slot=11.1) Then DS are created like follows: /profile=full/subsystem=datasources/data-source=CHAT_DS:add(driver-name="oracle",connection-url="jdbc:oracle:thin:@//xyz:1521/REGIST_LB_DEFAULT",jndi-name="java:jboss/datasources/CHAT_DS",security-domain="CHAT_DS-SEC-ID",new-connection-sql="SELECT current_timestamp FROM dual",min-pool-size=1,max-pool-size=32,check-valid-connection-sql="SELECT current_timestamp FROM dual") /profile=full/subsystem=datasources/data-source=ADT_DS:add(driver-name="oracle11.1",connection-url="jdbc:oracle:thin:@//xyz:1521/RESICST_LB_DEFAULT",jndi-name="java:jboss/datasources/ADT_DS",security-domain="ADT_DS-SEC-ID",new-connection-sql="SELECT current_timestamp FROM dual",min-pool-size=1,max-pool-size=32,check-valid-connection-sql="SELECT current_timestamp FROM dual") The debug statements showed the version 11.2.0.3 is used and not 11.1.0.7 as expected . Steps to Reproduce: 1. 2. 3. Actual results: version 11.2.0.3 is used and not 11.1.0.7 as expected . Expected results: version 11.1.0.7 used Additional info:
The customer identify the driver used with a snippet similar to: DatabaseMetaData meta = datasource.getConnection().getMetaData(); logger.info(msg + ": JDBC driver version is [" + meta.getDriverVersion() + "]");
Does this have something to do with JPA? It doesn't appear to but does have the JPA component marked on it..
The problem in this case is located in org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory::getDriver In this case the class driver is cached with the same string "jdbc:mysql". This cache is shared among every mcf (the field LocalManagedConnectionFactory::driverCache is static ). https://github.com/ironjacamar/ironjacamar/blob/ironjacamar-1.0.31.Final/adapters/src/main/java/org/jboss/jca/adapters/jdbc/local/LocalManagedConnectionFactory.java#L85 This makes not possible to use different versions of the same driver despite they belong to different datasources.
Jesper Pedersen <jpederse> updated the status of jira JBJCA-1253 to Closed
Blame JDK - use DataSource
I know this one is closed already. This issue has a pr merged already. https://github.com/ironjacamar/ironjacamar/pull/316
Jesper Pedersen <jpederse> updated the status of jira JBJCA-1258 to Resolved
Removing the cache functionality fixes this problem.
Jesper Pedersen <jpederse> updated the status of jira JBJCA-1258 to Closed
Jesper Pedersen <jpederse> updated the status of jira JBJCA-1258 to Reopened
This is already merged. Changing the status to MODIFIED. PR for 1.0.x https://github.com/ironjacamar/ironjacamar/pull/327
verified EAP 6.4.2.CP.CR1
Retroactively bulk-closing issues from released EAP 6.4 cumulative patches.