Suny95 opened a new issue #10396:
URL: https://github.com/apache/shardingsphere/issues/10396


   分表算法类中调用静态方法获取分表索引序号失败
   
![image](https://user-images.githubusercontent.com/26239751/118920182-77a56f00-b968-11eb-81fb-bc16d8063b0a.png)
   
   
![image](https://user-images.githubusercontent.com/26239751/118920256-a3c0f000-b968-11eb-9667-18bdfe532dca.png)
   
   图中的OrderClient类是Spring Bean,TABLE_COUNT静态字段是在该Bean初始化时赋值
   
   问题1:
   + 
目前的问题是在算法类中使用类OrderClient的静态方法getTableIndex无法正确获取到TABLE_COUNT修改后的值,只能获取到初始值,但在我们项目的业务代码中使用OrderClient的静态方法getTableIndex是可以拿到修改后的值的
   
   问题2:
   + 算法类中使用SpringContextHolder类获取Spring 
Bean也失败,因为ApplicationContext没有赋值到该类中导致,但在我们项目的业务代码中也是可以正常使用的
   
![image](https://user-images.githubusercontent.com/26239751/118920628-58f3a800-b969-11eb-96a8-42ba45c32d5b.png)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to