jimmycheng888 opened a new issue #2297: Hint route is closed after use
URL: https://github.com/apache/incubator-shardingsphere/issues/2297
 
 
   Which version of ShardingSphere did you use?
   3.1.0
   
   Which project did you use? Sharding-JDBC or Sharding-Proxy?
   Sharding-JDBC
   Actual behavior
   The first time I went to the database query, I was able to get the hint 
route, but the second time I couldn't get the hint route because 
HyintManager.close()
   
   ```
   HintManager hintManager = HintManager.getInstance();
   hintManager.addDatabaseShardingValue("t_user",“a”);
   hintManager.addDatabaseShardingValue("t_person",“a”);
   //After going to the database query successfully, you can get the hint route.
   List<User> imGroupList = userMapper.allUser();
   //Cannot get the hint route
   List<Person> imGroupList = personMapper.allPerson();
   
   ```
   **I hope that in the same method, I only need to use 
HintManager.getInstance(); once, because the project uses a lot of hint routes, 
which will lead to code confusion, and some colleagues' code is not 
standardized, or an exception causes HintManager.close() Not called, because I 
will encapsulate the HintManager in the custom annotation of the spring 
framework, unified control of the hint route**

----------------------------------------------------------------
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]


With regards,
Apache Git Services

Reply via email to