集成之后,无法进行cancel调用及全局事务id获取
checkHup opened this issue · comments
依赖是:使用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对应的实现类