wxrqforever opened a new issue, #7163: URL: https://github.com/apache/incubator-seata/issues/7163
一、背景介绍 有三个应用A、B、C,A、B能够接入seata,C为python开发无法seata。应用A提供了两个接口a1、a2,a1的调用链路为A、B因此使用的是AT模式,a2的调用链为A、B、C,因此使用的AT+Tcc模式。a2方法简化的相关代码如下: ``` //应用A的a2方法 @GloableTransactional public void a2(){ saveDb(); //rpc访问b2的prepare方法 b2Prepare(); //假设抛出异常 throw exception; } @TwoPhaseBusinessAction(name = "TccTestBean", commitMethod = "b2Commit", rollbackMethod = "b2Cancel") public void b2Prepare(){ //rpc访问B的b2接口 call B.b2(); } public void b2Commit(){ //不关键忽略 } public void b2Cancel(){ //rpc访问B的rollbackB2接口 call B.rollbackB2(); } ``` ``` //应用B的b2接口 public void b2(){ //模拟一些自己的db处理 saveDb(); } public void rollbackB2(){ //模拟一些自己的db处理 cleanDb(); } ``` 我遇到的问题是在应用A中,b2Prepare方法通过rpc访问B的b2接口时候,**全局的事务的头信息会被传递到B中**,b2中的saveDb方法会以at模式运行,会生成前后镜像,也会注册at分支。然后我的疑问是,如果这时候在a2中抛出了异常,那么对于at的部分b2中saveDb的数据会被清除,tcc部分rollbackB2方法也会被调用,**这对于B而言相当于执行了两次回滚,这是符合预期的吗**?**是否在tcc分支下应该抑制全局事务消息的传递?** -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@seata.apache.org.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@seata.apache.org For additional commands, e-mail: notifications-h...@seata.apache.org