New issue
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
Hint question shardingjdbc 5.4.1 #29780
Comments
demo project : https://github.com/yflytom/sharding-bug-demo-master.git |
Hi @yflytom |
Do you mean that I need to manually code and specify HintManager before querying sql and then enter my custom hint algorithm? If so, don’t every query need to be manually coded and specified? Instead, after entering the algorithm Specify the data source and table again? Or can you provide some cases? |
Hello, I don’t quite understand. I can clearly specify the data sources and tables that need to be queried through custom algorithms. Why do I need to code 您好,我不是太明白,明明可以通过自定义算法里面指定需要查询的数据源和表,为什么还要编码 |
Please see the Code |
So how to know the sharding value in your custom sharding algorithm? |
Hello, I use Alibaba's 您好,我是使用阿里的TransmittableThreadLocal 传递参数,我看了Shardingjdbc 也有这个,是否可以开放两种方式,一种自定义的传参,一种是使用HintManager |
The current I suggest that you describe the design in detail and how it is used, and then submit a PR. |
There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale. |
Closed due to no response. |
shardingjdbc 5.4.1
pom.xml
The following two pictures
HINT
have different local configuration methods. When I use the method of picture 1 to configure, an error will be reported. (下面这两个图片HINT
地方配置方式不一致,当我使用图片1的方式进行配置,会报错)sharding.yaml
error msg: (报错信息)
And it will flush logs crazily, causing the CPU to increase and the fan to spin wildly.(并且会疯狂刷日志,导致CPU升高,风扇狂转)
When I use the other configuration in Picture 2, no error will be reported, but it will not enter my custom algorithm. If I specify two data sources, it will query two data sources, and if it is three, it will query three data sources.
(当我使用图片2的另一种方式配置,不会报错,但是不会进入我的自定义算法中,指定两个数据源,他就查询两个数据源,三个就查询三个数据源)
查询
Custom algorithm
question:
(问题:
1、我到底应该怎样配置使用hint 强制路由,我是为了实现sas架构,多租户功能,通过指定hint算法,执行时获取对应用户所属库,hint强制指定数据源功能)
非常感谢!
The text was updated successfully, but these errors were encountered: