关于csrf:2312321312

45次阅读

共计 443 个字符,预计需要花费 2 分钟才能阅读完成。

2131232132131232132132131

@Service
public class MultiDatasourceService {

    @Resource
    private MultiDatasourceService multiDatasourceService;

    @Resource
    private TestMapper testMapper;

    @Transactional
    public void updateNameById(Long id) {
        int i = 1;
        testMapper.updateById(id, "clcl");
        // 调用另外一个事务办法
        multiDatasourceService.updateNameById1(id);
        int j = 2;
    }

    @Transactional(propagation = Propagation.REQUIRES_NEW)
    public void updateNameById1(Long id) {
            int i = 1;
        testMapper.updateById(3L, "clcl");
    }
}

正文完
 0