gavenpeng opened a new pull request, #18317:
URL: https://github.com/apache/shardingsphere/pull/18317

   Increment feature:
   
   Changes proposed in this pull request:
   - 1 对强制路由做了增强,不需要规则配置为Hint模式,只要线程上下文带有强制路由的标志,就可以路由到指定的库和表,
   不受分表规则的影响.
   - 2 使用demo:
   ```
   public void demoFunc() {
       // 实例化HintManager
       HintManager hintManager = HintManager.getInstance();
       // 强制路由到哪个分库,具体的分库名见paas平台上的分片配置,一般是:ds_0,ds_1这种
       hintManager.addDatabaseShardingValue("logic_database_name(请填写你的逻辑库名)", 
"databaseName_name(请填写你的真实库名)");
       // 强制路由到哪个真实表
       hintManager.addTableShardingValue("logic_table_name(请填写你的逻辑表名)", 
"real_table_name(请填写你的真实表名)");
       try {     // java7之后,也可以使用try-with-resource写法!!
           xxxxxxx   // 业务逻辑
       } catch (Throwable e) {
           xxxxxxx   // 业务逻辑
       } finally {
           // 必须要写,不能少,切记,切记!!!!否则后面都会出错
           hintManager.close();   
       }
   }
   ```
   


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

To unsubscribe, e-mail: [email protected]

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

Reply via email to