mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-07 00:58:24 +08:00
fix: 读写分离自定义分离策略不生效 close #I8FP0K
This commit is contained in:
parent
54afe053b2
commit
6ffd9cdab5
@ -98,6 +98,13 @@
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.mybatis-flex</groupId>
|
||||
<artifactId>mybatis-flex-annotation</artifactId>
|
||||
<version>1.7.3</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
||||
@ -70,7 +70,7 @@ public class MapperInvocationHandler implements InvocationHandler {
|
||||
//最终通过数据源 自定义分片 策略去获取
|
||||
String shardingDataSourceKey = DataSourceKey.getByShardingStrategy(dataSourceKey, proxy, method, args);
|
||||
if (shardingDataSourceKey != null && !shardingDataSourceKey.equals(dataSourceKey)) {
|
||||
DataSourceKey.use(dataSourceKey);
|
||||
DataSourceKey.use(shardingDataSourceKey);
|
||||
needClearDsKey = true;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user