服务拆分后,由于服务之间的调用导致事务处理成为难题。阿里开源的seata框架,很好的解决了事务问题,并且对业务没有侵入性,但是官网说明太少,导致部署的时候出了很多错。springboot+mybatis+seata不需要修改file.conf和register.conf两个文件。下面是springboot+mybatis+seata部署的详细流程,希望对大家有用。
1、seata事务处理机制,查看官网:https://github.com/seata/seata
2、idea git下载seata-sample项目,下载地址:https://github.com/seata/seata-samples
3、官网下载seata-server:https://github.com/seata/seata/releases,解压seata-server-0.8.0.zip
4、启动seata-server:
- file:存储
启动seata-server:进入seata-server-0.8.0\bin目录,shift+鼠标右键,选择在此处打开powershell窗口,执行如下命令:./seata-server.bat -h 127.0.0.1 -p 8091 -m file
- db:存储
创建数据库:seata ,执行seata-server-0.8.0\conf目