Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

集成之后,无法进行cancel调用及全局事务id获取 #153

Open
checkHup opened this issue Apr 10, 2023 · 0 comments
Open

集成之后,无法进行cancel调用及全局事务id获取 #153

checkHup opened this issue Apr 10, 2023 · 0 comments

Comments

@checkHup
Copy link

依赖是:使用0.5.12版本,使用nacos注册中心
服务类是:
`@Service("deviceFirmServiceImpl")
@Compensable(interfaceClass = IDeviceFirmService.class,cancellableKey = "deviceFirmCancelService")
public class DeviceFirmServiceImpl extends ServiceImpl<DeviceFirmMapper, DeviceFirm> implements IDeviceFirmService , CompensableContextAware {

//@Resource
//private RestTemplate restTemplate;

@Resource
private DeviceFirmMapper deviceFirmMapper;

@Resource
private TestService testService;


@Transactional(rollbackFor = Exception.class)
public Object tryupdateTest(DeviceFirm deviceFirm){
    testService.get();
    int i=1/0;
    getBaseMapper().updateFirm(new DeviceFirm());
    return 0;
}

private CompensableContext compensableContext;
@Override
public void setCompensableContext(CompensableContext compensableContext) {
    this.compensableContext = compensableContext;
}

|`

cancel的实现类
@service("deviceFirmCancelService")
public class DeviceFirmCancelService extends ServiceImpl<DeviceFirmMapper, DeviceFirm> implements IDeviceFirmService , CompensableContextAware {

@Transactional(rollbackFor = Exception.class)
@Override
public Object tryupdateTest(DeviceFirm deviceFirm) {
    return null;
}

private CompensableContext compensableContext;
@Override
public void setCompensableContext(CompensableContext compensableContext) {
    this.compensableContext = compensableContext;
}

}

一、compensableContext无法获取到值
二、无法进入cancel对应的实现类

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant