浏览代码

修改不能出现2个主事务冲突bug

梁欢 6 天之前
父节点
当前提交
2ba3614ae6
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 4 4
      src/main/java/cn/hnthyy/thmz/ureport/datasource/UreportDataSource.java

+ 4 - 4
src/main/java/cn/hnthyy/thmz/ureport/datasource/UreportDataSource.java

@@ -47,7 +47,7 @@ public class UreportDataSource extends BaseDataSource {
 
     @Bean(name = "ureportConfiguration")
     @ConfigurationProperties(prefix = "mybatis-plus.configuration")
-    @Primary
+//    @Primary
     public MybatisConfiguration ureportConfiguration() {
         return new MybatisConfiguration();
     }
@@ -86,7 +86,7 @@ public class UreportDataSource extends BaseDataSource {
     }
 
     @Bean(name = "ureportSqlSessionFactory")
-    @Primary
+//    @Primary
     public SqlSessionFactory ureportSqlSessionFactory(@Qualifier("ureportData") DataSource dataSource, @Qualifier("ureportConfiguration") MybatisConfiguration configuration) throws Exception {
         //SqlSessionFactoryBean bean = new SqlSessionFactoryBean();
         MybatisSqlSessionFactoryBean bean = new MybatisSqlSessionFactoryBean();
@@ -97,13 +97,13 @@ public class UreportDataSource extends BaseDataSource {
     }
 
     @Bean(name = "ureportTransactionManager")
-    @Primary
+//    @Primary
     public DataSourceTransactionManager ureportTransactionManager(@Qualifier("ureportData") DataSource dataSource) {
         return new DataSourceTransactionManager(dataSource);
     }
 
     @Bean(name = "ureportSqlSessionTemplate")
-    @Primary
+//    @Primary
     public SqlSessionTemplate ureportSqlSessionTemplate(@Qualifier("ureportSqlSessionFactory") SqlSessionFactory sqlSessionFactory) throws Exception {
         return new SqlSessionTemplate(sqlSessionFactory);
     }