I have configured User Defined datasource for MySQL database using below.

  • WebSphere 8.5
  • mysql-cluster-gpl-7.4.6
  • mysql-connector-java-5.1.9-bin.jar

Implementation Class in Provider :

  • com.mysql.jdbc.jdbc2.optional.MysqlXADataSource

However, I get below exception for JTA transaction spanning MySQL and Oracle datasource operation for MySQL datasource.

E WTRN0063E: An illegal attempt to commit a one phase capable resource with existing two phase capable resources has occurred.

As per docs, MySQL supports XA-transaction, My driver is implementing XADatasource.

Can you confirm what is it that I am missing. May be datasource configuration that it is not two phase capable transactional resources?

I have also used ENGINE=INNODB to create MySQL table.

1

There are 1 answers

3
Andy Guibert On

It sounds like you need to configure your datasource to be XA capable on the WebSphere side. By default, WAS datasource will not implement javax.sql.XADataSource.

See this WAS 8.5 documentation link (section 8.e) to verify your config is using an XA datasource: http://www-01.ibm.com/support/knowledgecenter/SSEQTP_8.5.5/com.ibm.websphere.base.doc/ae/tdat_ccrtpds.html?cp=SSEQTP_8.5.5%2F1-3-0-23-3-0-7-1