kpioneer123 commented on issue #7380:
URL: https://github.com/apache/shardingsphere/issues/7380#issuecomment-695943678
**service code:**
```
@Override
@GlobalTransactional(timeoutMills = 300000,name =
"account-service",rollbackFor = Exception.class)
public void shardingSeata() throws Exception {
System.out.println("开始全局事务,XID = " + RootContext.getXID());
System.out.println("开始全局事务,rollbackinfo = " + RootContext.getXID());
BookPunchDTO bookPunch = new BookPunchDTO();
bookPunch.setUserId(100068863);
bookPunch.setBookId(10097L);
BookFans bookFans = new BookFans();
BeanUtils.copyProperties(bookPunch,bookFans);
bookPunchService.add(bookPunch);
//bookPunchService.add method roll-back Seata work
if (bookPunch.getBookId()==10097L) {
throw new Exception("回滚回滚");
}
```
**log show XID exists**
```
15:11:17.191 INFO [main] io.seata.tm.api.DefaultGlobalTransaction - Begin
new global transaction [39.106.112.246:8091:51326012352454656]
开始全局事务,XID = 39.106.112.246:8091:51326012352454656
15:11:17.238 INFO [main] io.seata.core.rpc.netty.RmNettyRemotingClient -
will register
resourceId:jdbc:mysql://rdsql815s2568iryqn93o.mysql.rds.aliyuncs.com:3306/bookdb
15:11:17.245 INFO [NettyClientSelector_RMROLE_1_1]
io.seata.rm.AbstractRMHandler - the rm client received response msg
[version=1.4.0-SNAPSHOT,extraData=null,identified=true,resultCode=null,msg=null]
from tc server.
开始全局事务,XID = 39.106.112.246:8091:51326012352454656
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]