Uninote
Uninote
用户根目录
工作日志

分布式事务必须增加这个


    /**
     * init mybatis sqlSessionFactory.   这里主要是定义了 一个代理 类 用来代理mybatis, 应为目前就用到mybatis
     * @Param: dataSourceProxy  datasource proxy
     * @Return: DataSourceProxy  datasource proxy
     */
    @Bean
    public SqlSessionFactory sqlSessionFactory(DataSourceProxy dataSourceProxy) throws Exception {
        SqlSessionFactoryBean factoryBean = new SqlSessionFactoryBean();
        factoryBean.setDataSource(dataSourceProxy);
        factoryBean.setMapperLocations(new PathMatchingResourcePatternResolver()
                .getResources("classpath*:/mapper/*.xml"));
        factoryBean.setTransactionFactory(new JdbcTransactionFactory());
        return factoryBean.getObject();
    }

Java诊断工具arthas使用

SpringCloud

点赞(0) 阅读(21) 举报
目录
标题