simzyoo commented on issue #7323:
URL: 
https://github.com/apache/incubator-seata/issues/7323#issuecomment-2834725914

   > > > 注解化只需要与tcc一样增加注解,不需要流程编排的json文件,也不需要绘制对应的状态机流程。
   > > > ```
   > > > @CompensationBusinessAction(name = "DubboSagaActionOne", 
compensationMethod = "compensation")
   > > >     public boolean prepare(BusinessActionContext actionContext, 
@BusinessActionContextParameter(paramName = "a") int a) {
   > > > }
   > > > 
   > > > @Override
   > > >     public boolean compensation(BusinessActionContext actionContext) {
   > > > }
   > > > ```
   > > > 
   > > > 
   > > >     
   > > >       
   > > >     
   > > > 
   > > >       
   > > >     
   > > > 
   > > >     
   > > >   
   > > > 增加上述注解即可 name为资源名,定位到这个bean所需,故需要唯一值 
compensationMethod为二阶段决议回滚时触发的方法名,需要定义该方法在该bean中。
   > > 
   > > 
   > > 
好的,多谢。再请教下是否也和tcc一样,二阶段也是由tc异步发起的?这里和tc的交互流程是否是,如果全局事务提交,那就直接结束,tc不会像tcc模式那样回调commit,因为没有,而如果是全局事务回滚,那就是tc会异步回调补偿方法,对吗?
   > 
   > 是的,等于没有confirm方法也就是没有commit的tcc,完全由业务自定义一阶段做什么,如果异常了在做什么补偿。
   
   好的 多谢 最后还想再请教下 这种注解的实现方式和状态机的实现方式 在和tc的交互上有区别吗?状态机方式的二阶段会是由应用自己触发的还是tc触发的?


-- 
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

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

Reply via email to