We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
interceptor.addInnerInterceptor(new TenantLineInnerInterceptor(new TenantLineHandler() { @Override public Expression getTenantId() { return new StringValue(ContextHolder.getTenant()); } @Override public boolean ignoreTable(String tableName) { return false; } }));
发现count条件中并没有tenant_id
一切正常,count条件中存在tenant_id
The text was updated successfully, but these errors were encountered:
Sorry, something went wrong.
考虑增加一个简单接口允许处理上下文。。在进入异步线程前执行a()方法,进入异步线程执行后执行b()方法。
a()方法可以先从ThreadLocal取值,b()方法可以存值。。执行完成后执行c()方法清理ThreadLocal,你看看是否可行?
意思是要手动把条件塞进去吗? 这样count是可以,但是正常的列表查询就会出现两条相同的条件。 目前开启异步count的话,是不是所有的实现mybatisPlus的InnerInterceptor拦截器都存在问题? 之后版本会修复这个问题吗?
首先这不算问题,主要是ThreadLocal线程绑定的原因,如果在mybatis中遇到类似拦截器,都需要手动在新线程上进行绑定。
你这种情况就别用异步count了。
No branches or pull requests
使用环境
配置多租户插件
开启异步count支持后
发现count条件中并没有tenant_id
关闭异步count支持后
一切正常,count条件中存在tenant_id
The text was updated successfully, but these errors were encountered: