当前使用版本(必填,否则不予处理)
3.5.0
该问题是如何引起的?(确定最新版也有问题再提!!!)
当某个接口使用了SimpleQuery.list方法时,多次访问该接口时,大概四五次后,该接口会进入卡死状态,如下图:
接口代码如下:
@RestController
@RequestMapping("/api/test/simp")
public class QixiaozhuRequestLoginfoController extends BaseController {
@PostMapping("/test")
public ResultBody test(){
List<String> list = SimpleQuery.list(Wrappers.lambdaQuery(), QixiaozhuSubject::getName);
return renderData(list);
}
}
getMapper代码块:
@SuppressWarnings("unchecked")
@Override
public <T> T getMapper(Class<T> type, SqlSession sqlSession) {
// TODO 这里换成 MybatisMapperProxyFactory 而不是 MapperProxyFactory
MybatisMapperProxyFactory<T> mapperProxyFactory = (MybatisMapperProxyFactory<T>) knownMappers.get(type);
if (mapperProxyFactory == null) {
mapperProxyFactory = (MybatisMapperProxyFactory<T>) (knownMappers.entrySet().stream()
.filter(t -> t.getKey().getName().equals(type.getName())).findFirst()
.orElseThrow(() -> new BindingException("Type " + type + " is not known to the MybatisPlusMapperRegistry.")).getValue());
}
try {
return mapperProxyFactory.newInstance(sqlSession);
} catch (Exception e) {
throw new BindingException("Error getting mapper instance. Cause: " + e, e);
}
}
Comment From: VampireAchao
最新版已处理,请耐心等待升级更新
Comment From: ghost
好的
Comment From: zxhdaniel
今天也遇到这个问题了,也是3.5.0版本,看了commit记录已经有人修复了,耐心等待新版。