xiaoxiangyeyu0 commented on issue #7690: URL: https://github.com/apache/incubator-seata/issues/7690#issuecomment-3413678541
调用org.apache.seata.rm.datasource.xa.ConnectionProxyXA.xaRollback(XAXid)方法一共是下面4个地方checkTimeout(Long)、rollback()、start()、xaRollback(String, long, String) 对于checkTimeout方法,是在close方法调用的,close方法调用checkTimeout前会调用end(int)方法,end调用xaEnd调用到xaResource.end(xaXid, flags); 对于rollback方法,调用xaRollback方法前,也会调用xaEnd调用到xaResource.end(xaXid, flags); 对于start方法,直接会调用到xaResource.end(this.xaBranchXid, XAResource.TMFAIL); 上面这3个方法都是close前会调用到的,都会提前end,xaResource.rollback(xaXid);就会成功。 对于xaRollback(String, long, String)是二阶段调用的,如果是新连接,直接xaResource.rollback就好,如果拿到旧连接,这个连接在一阶段肯定被end过了。 所以直接把166行去掉就好 -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
