Nacos 与 Seata

abithluo  于 2个月前  发布在  Nacos
关注(0)|答案(3)|浏览(42)
  • I have searched the issues of this repository and believe that this is not a duplicate.

Ⅰ. Issue Description

Nacos 动态刷新后,Seata全局事务获取不到xid,发生异常后,事务不生效,数据没有回滚

Ⅱ. Describe what happened

在service层,使用@RefreshScope注解开启动态刷新配置,在方法上使用@GlobalTransactional注解开启全局事务。
nacos动态刷新配置后,seata获取到的xid为空。RootContext.getXID(),

If there is an exception, please attach the exception trace:

Just paste your stack trace here!

Ⅲ. Describe what you expected to happen

nacos动态刷新配置后,发生异常事务可以正常回滚

Ⅳ. How to reproduce it (as minimally and precisely as possible)

  1. nacos2.0.0
  2. seata1.4.1

Ⅴ. Anything else we need to know?

Ⅵ. Environment:

  • JDK version : 1.8
  • OS : Linux
  • Others:
fhity93d

fhity93d1#

@RefreshScope 会销毁bean重新创建,此时这个bean可能并没有被代理,这是一个问题,我们后续验证一下

o2g1uqev

o2g1uqev2#

暂时先试用@NacosValue来代替@RefreshScope的动态更新吧

相关问题