兼容非seata

This commit is contained in:
life 2023-08-07 16:35:27 +08:00
parent f8efef2e18
commit 37a085c1be
2 changed files with 4 additions and 3 deletions

View File

@ -93,8 +93,9 @@
<dependency>
<groupId>io.seata</groupId>
<artifactId>seata-spring-boot-starter</artifactId>
<version>1.5.2</version>
<artifactId>seata-rm-datasource</artifactId>
<version>1.7.0</version>
<optional>true</optional>
</dependency>
</dependencies>

View File

@ -82,7 +82,7 @@ public class MultiDataSourceAutoConfiguration {
for (Map.Entry<String, Map<String, String>> entry : dataSourceProperties.entrySet()) {
DataSource dataSource = new DataSourceBuilder(entry.getValue()).build();
if (seataConfig.isEnable()){
if (seataConfig !=null &&seataConfig.isEnable()){
if (seataConfig.getSeataMode() ==SeataMode.XA){
dataSource = new DataSourceProxyXA(dataSource);
}else {