admin
2021-04-13 594ce0ec17a858987868cb815c44ef0b363b5010
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package com.yeshi.buwan.service.manager;
 
import org.springframework.stereotype.Component;
 
@Component
public class SeataManagerTest {
//
//    @Resource
//    private LoginUserDao loginUserDao;
//
//    @Reference(version = "1.0")
//    private GoldCornGetSourceService goldCornGetSourceService;
//
//    @GlobalTransactional(timeoutMills = 30000, name = "buwan-order", rollbackFor = Exception.class)
//    public void addGetResource() throws Exception {
//        System.out.println("开始全局事务,XID = " + RootContext.getXID());
//        LoginUser loginUser = new LoginUser();
//        loginUser.setId("50134");
//        loginUser.setName("test3");
//        loginUserDao.updateSelective(loginUser);
//
//        GoldCornGetSource get = new GoldCornGetSource();
//        get.setAppId(15L);
//        get.setSourceCode("test1");
//        get.setSourceName("测试");
//        get.setGoldCorn(1);
//
//        goldCornGetSourceService.addSource(get);
//        throw new Exception("手动报错");
//    }
 
}