一、该问题的重现步骤是什么?
1.
@TenantDS
@Service
TestServiceImpl BaseServiceImpl<TestMapperTestEntity> ITestService { IPage<TestVO> (IPage<TestVO> pageTestVO test) { page.setRecords(.selectTestPage(pagetest))} }
2. 显示成功获取租户id
2023-03-07 22:20:18.335 INFO 51520 --- [ main] c.b.d.d.p.AbstractJdbcDataSourceProvider : 成功加载数据库驱动程序
2023-03-07 22:20:18.410 INFO 51520 --- [ main] c.b.d.d.p.AbstractJdbcDataSourceProvider : 成功获取数据库连接
2023-03-07 22:20:18.516 INFO 51520 --- [ main] com.alibaba.druid.pool.DruidDataSource : {dataSource-1,792412} inited
2023-03-07 22:20:18.518 INFO 51520 --- [ main] com.alibaba.druid.pool.DruidDataSource : {dataSource-2,master} inited
2023-03-07 22:20:18.521 INFO 51520 --- [ main] c.b.d.d.DynamicRoutingDataSource : dynamic-datasource - add a datasource named [792412] success
2023-03-07 22:20:18.521 INFO 51520 --- [ main] c.b.d.d.DynamicRoutingDataSource : dynamic-datasource - add a datasource named [master] success
3. 未用租户id进行查询
============== Sql Start ==============
Execute SQL : select datasource_id from blade_tenant where is_deleted = 0 and tenant_id = ''
Execute Time: 11.218ms
============== Sql End ==============
org.springblade.core.tenant.exception.TenantDataSourceException: Incorrect result size: expected 1, actual 0
二、你期待的结果是什么?实际看到的又是什么?
select datasource_id from blade_tenant where is_deleted = 0 and tenant_id = '792412',期待这样进行查询,正确返回数据源
三、你正在使用的是什么产品,什么版本?在什么操作系统上?
BladeX,3.0.1,Windows
四、请提供详细的错误堆栈信息,这很重要。
============== Sql Start ==============
Execute SQL : select datasource_id from blade_tenant where is_deleted = 0 and tenant_id = ''
Execute Time: 11.218ms
============== Sql End ==============
org.springblade.core.tenant.exception.TenantDataSourceException: Incorrect result size: expected 1, actual 0
五、若有更多详细信息,请在下面提供。
扫一扫访问 Blade技术社区 移动端