How to set up Spring Boot + Bitronix + non-XA Datasource + XA JMS Connection

北城以北 提交于 2019-12-11 12:36:45

问题


I'm trying to set-up Bitronix in Spring Boot to use last resource gambit with non-XA datasource. Of course by default (autoconfiguration) data source does not participate in XA transaction. It seems that org.springframework.boot.jta.XADataSourceWrapper will work only for XADataSource.

How to connect DataSource with Bitronix?


回答1:


Bitronix uses its LrcXADataSource to implement the last resource gambit. You need to tell Spring Boot to create an XAResource of that type:

spring.datasource.xa.data-source-class-name=bitronix.tm.resource.jdbc.lrc.LrcXADataSource

You'll also need to set some other properties that will depend on the database you're using and how it's configured. For example, the name of the JDBC driver class:

spring.datasource.xa.properties.driver-class-name=org.hsqldb.jdbcDriver


来源:https://stackoverflow.com/questions/34949892/how-to-set-up-spring-boot-bitronix-non-xa-datasource-xa-jms-connection

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!