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
JDK Version(required): 8
SpringBoot Version(required): 2.7.14
dynamic-datasource-spring-boot-starter Version(required):3.3.2
druid Version(optional):HikariCP-4.0.5
如题: 多租场景下,做部分聚合操作,需要从不同租户的数据库中拿目标数据;
`DynamicDataSourceContextHolder.push("A");//A租户数据源 jdbcTemplate.queryForList("select * from user");
DynamicDataSourceContextHolder.push("B");//B租户数据源 jdbcTemplate.queryForList("select * from user");`
上述代码顺序执行,发现执行B数据源操作时,仍然使用A租户的数据源,使用的同一个sqlSession
Expected Result:
切换到B后,能去B对应的库中查询数据
Actual Result: 仍然在A的库中查数据
The text was updated successfully, but these errors were encountered:
请提供复现程序
Sorry, something went wrong.
No branches or pull requests
JDK Version(required): 8
SpringBoot Version(required): 2.7.14
dynamic-datasource-spring-boot-starter Version(required):3.3.2
druid Version(optional):HikariCP-4.0.5
Describe what happened
如题:
多租场景下,做部分聚合操作,需要从不同租户的数据库中拿目标数据;
`DynamicDataSourceContextHolder.push("A");//A租户数据源
jdbcTemplate.queryForList("select * from user");
DynamicDataSourceContextHolder.push("B");//B租户数据源
jdbcTemplate.queryForList("select * from user");`
上述代码顺序执行,发现执行B数据源操作时,仍然使用A租户的数据源,使用的同一个sqlSession
Expected Result:
切换到B后,能去B对应的库中查询数据
Actual Result:
仍然在A的库中查数据
The text was updated successfully, but these errors were encountered: