apache / incubator-seata

:fire: Seata is an easy-to-use, high-performance, open source distributed transaction solution.
https://seata.apache.org/
Apache License 2.0
25.28k stars 8.78k forks source link

spring cloud alibaba 整合 sharding jdbc + nacos + seata时,服务之间调用,SeataTransactionHolder commit时丢失问题 #4813

Open LeiGaoRobot opened 2 years ago

LeiGaoRobot commented 2 years ago

Ⅰ. Issue Description

spring cloud alibaba 整合 sharding jdbc + mybatis plus + nacos + seata 1.5.2,在服务之间调用时, SeataATShardingTransactionManager 的 commit 里 seataTransactionHolder get 一直为空,在之前 begin 里 SeataTransactionHolder set是有值

Ⅱ. Describe what happened

在服务之间调用时,事务commit错误如下:

调用服务

image

被调用服务

image image image

错误信息:

image image image

服务中seate配置如下

image image image

Ⅲ. Describe what you expected to happen

请教一下,为什么会为空

Ⅵ. Environment:

funky-eyes commented 2 years ago

应该是sharding jdbc和seata的兼容问题,seta是被sharding jdbc被动集成的,可以去问下他们那块

LeiGaoRobot commented 2 years ago

应该是sharding jdbc和seata的兼容问题,seta是被sharding jdbc被动集成的,可以去问下他们那块

image

覆盖重写了 SeataTransactionHolder get的地方。没有的话就去读取当前全局事务,这样改完倒是可以用了。但不知道是不是会发生其他问题。请教一下,这样会有问题吗。