关于csrf:2312321312

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");
    }
}

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理