皆非的万事屋

【Seata】1.4.2使用教程和注意事项

本博客截取自分布式新生电子报道系统

Seata搭建

[scode type="share"]为seata建数据库,导sql[/scode]

[scode type="share"]双击seata-server.bat启动[/scode]

结果

@Service
@Slf4j
@RequiredArgsConstructor
public class StudentPraiseServiceImpl extends ServiceImpl<StudentPraiseMapper, StudentPraise> implements IStudentPraiseService {

    private final StudentPraiseMapper studentPraiseMapper;

    //erc-student模块的服务
    private final IStudentsService studentsService;

    //erc-openid模块的服务
    private final IOpenIdService openIdService;

    @Override
    @GlobalTransactional
    public Boolean clickWish( String cartId, String openId ) {
        log.info("【学生身份证为:】" + cartId + "【当前用户的openid为】" + openId);
        Integer openIdCount = openIdService.selectCount(openId);
        .......
    }
}

附录

[scode type="yellow"]问题1:引入seata的项目启动报错,提示数据源方面的问题[/scode]

当前页面是本站的「Google AMP」版。查看和发表评论请点击:完整版 »