Closed cwqbupt closed 5 months ago
BussinessService
is just an action trigger. What it does is to wrap RPC calls with @GlobalTransactional
. In that case, there is no need for special configuration in XA mode.Thank you for raising it. I would fix those issues.
为这响应速度点赞!
还有个小问题,配置中的:spring.datasource.url=jdbc:mysql://127.0.0.1:3306/seata?userSSL=false&useUnicode=true&characterEncoding=UTF8 userSSL拼写错误,应该是useSSL
我运行至少遇到这几个问题: 1 :bussiness默认AT mode而不是XA mode 2:order项目缺少controller文件,以致于bussniss找不到rpc create方法 3:storage项目显示xid为null: 2024-04-15 21:41:57.315 INFO 24345 --- [nio-8081-exec-1] org.apache.seata.service.StorageService : Stock Service Begin ... xid: null 2024-04-15 21:41:57.315 INFO 24345 --- [nio-8081-exec-1] org.apache.seata.service.StorageService : Deducting inventory SQL: update stock_tbl set count = count - 2 where commodity_code = C00321 2024-04-15 21:41:57.322 INFO 24345 --- [nio-8081-exec-1] org.apache.seata.service.StorageService : Stock Service End ... ^@^@^@^@^@2024-04-15 21:46:23.923 INFO 24345 --- [nio-8081-exec-3] org.apache.seata.service.StorageService : Stock Service Begin ... xid: null 2024-04-15 21:46:23.924 INFO 24345 --- [nio-8081-exec-3] org.apache.seata.service.StorageService : Deducting inventory SQL: update stock_tbl set count = count - 2 where commodity_code = C00321 2024-04-15 21:46:23.925 INFO 24345 --- [nio-8081-exec-3] org.apache.seata.service.StorageService : Stock Service End ...
最终结果是:purchase运行失败,但是库存却减少了: mysql> select * from stock_tbl; +----+----------------+-------+ | id | commodity_code | count | +----+----------------+-------+ | 24 | C00321 | 98 | +----+----------------+-------+