Bug Report: JDBC javax.sql.XADatasource type pool doesn't return XADatasource instance #6450
Labels
Status: Accepted
Confirmed defect or accepted improvement to implement, issue has been escalated to Platform Dev
Type: Bug
Label issue as a bug defect
Brief Summary
We configure the jdbc connection pool to be an javax.sql.XADataSource but when we query the data source in code to determine if it is an javax.sql.XADataSource then we have the following code,
ds.unwrap(javax.sql.XADataSource)
and this throws an exception because the DataSource we receive does not implement javax.sql.XADataSource.
Configurations used to define the connection pool.
We see javax.sql.XADatasource type at the admin console too.
When we check the datasource it is an instance of com.sun.gjc.spi.jdbc40.DataSource40 class.
Expected Outcome
We expect a datasource instance which implements javax.sql.XADataSource otherwise we can not decide if if is a XA or not.
Current Outcome
We got an instance of com.sun.gjc.spi.jdbc40.DataSource40 class and it is implementing javax.sql.Datasource not javax.sql.XADatasource.
Reproducer
Declare a datasource and retrieve it with following case, you can see the SQLException.
Operating System
macOS Monterey / Version 6.2023.6
JDK Version
openjdk/17.0.2
Payara Distribution
Payara Server Full Profile
The text was updated successfully, but these errors were encountered: