I am trying to both administer 2 Oracle 21c databases and write a Java app that uses XA transactions against them. I've never administered XA support on databases and have had a hard time finding step-by-step instructions on Oracle's site and others.
When I run the following Java code...
oracle.jdbc.xa.client.OracleXADataSource xaDataSource = new OracleXADataSource xaDataSource = new OracleXADataSource();
xaDataSource.setURL(...);
xaDataSource.setURL(...);
xaDataSource.setPassword(...);
Connection xaConn = xaDataSource.getConnection();OracleXADataSource();
I get this exception...
java.sql.SQLException: ORA-17023: Unsupported feature
https://docs.oracle.com/error-help/db/ora-17023/
at oracle.jdbc.driver.SQLStateMapping$SqlExceptionType$1.newInstance(SQLStateMapping.java:58)
at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:169)
at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:175)
at oracle.jdbc.driver.DatabaseError.createSqlException(DatabaseError.java:226)
at oracle.jdbc.driver.DatabaseError.createSqlException(DatabaseError.java:299)
at oracle.jdbc.driver.DatabaseError.createSqlException(DatabaseError.java:320)
at oracle.jdbc.driver.DatabaseError.createSqlException(DatabaseError.java:456)
at oracle.jdbc.driver.DatabaseError.createSqlException(DatabaseError.java:437)
at oracle.jdbc.datasource.impl.OracleConnectionPoolDataSource.getConnection(OracleConnectionPoolDataSource.java:243)
at com.mycompany.XATest.main(XATest.java:25)
NOTE: I do not get this exception when I use the non-XA oracle.jdbc.OracleDriver.
I assume that XA support is not enabled by default on my Container Database (CDB) and/or Pluggable Databases (PDBs). But I'm not entirely positive.
What do I do to ensure my PDBs allow my Java app to connect with that XA driver? Do I grant permissions? Do I run some SQL scripts?