You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2020/07/14 06:07:06 UTC

[GitHub] [shardingsphere] SirMin commented on issue #6342: Why does HintManager's getInstance return a new HintManager instead of returning the one held by the current thread

SirMin commented on issue #6342:
URL: https://github.com/apache/shardingsphere/issues/6342#issuecomment-657987672


   ```
   public static HintManager getInstance() {
           Preconditions.checkState(null == HINT_MANAGER_HOLDER.get(), "Hint has previous value, please clear first.");
           HintManager result = new HintManager();
           HINT_MANAGER_HOLDER.set(result);
           return result;
       }
   ```
   I want to set masterRouteOnly in Custom annotation and  setDatabaseShardingValue in business code, But HintManager's getInstance return new everytime.
   So i want to know why this is done.


----------------------------------------------------------------
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:
users@infra.apache.org