1. Abnormal report: Could not register branch into global session xid =xxx.xxx.xx.xxx status = Rollbacked
2. Abnormal cause:
while expecting Begin # Description: When registering a branch transaction, the global transaction state must be the first-stage state begin, and registration is not allowed unless it is begin. It belongs to the normal processing at the seata framework level, and users can solve it from their own business level.
3. Scenarios:
1. The branch transaction is asynchronous, and the global transaction cannot perceive its execution progress. The global transaction has entered the second phase, and the asynchronous branch is registered
2. Service a The rpc service b timed out (dubbo, feign, etc. default to a timeout of 1 second), a throws an exception to tm, and tm notifies tc to roll back, but b still receives the request (network delay or rpc framework retry), and then finds out when registering with tc The global transaction has been rolled back
3. tc perceives the global transaction timeout (@GlobalTransactional(timeoutMills = 60 seconds by default)), actively changes the status and notifies each branch transaction to roll back, and there is a new branch transaction to register at this time
4. The method of adding transaction annotation is not the first place to execute the sql statement, that is, the transaction annotation is added to method A, but method B is called before the sql operation is executed in method A, and method B belongs to the branch transaction. The sql operation in method B is executed before the sql operation in method A.