local-li opened a new issue, #21156:
URL: https://github.com/apache/shardingsphere/issues/21156

   
我在org.apache.shardingsphere.transaction.xa.XAShardingTransactionManager中发现close方法。
   ```java
     @Override
       public void close() throws Exception {
           for (XATransactionDataSource each : cachedDataSources.values()) {
               each.close(); // 依次移除 
Configuration.removeResource(res.getName());
           }
           cachedDataSources.clear();
           xaTransactionManager.close();  // 
他会调用userTransactionService.shutdown(true);
       }
   ```
   However, call userTransactionService.shutdown(true); Is to shut down all 
resources in the Configuration. Isn't this unnecessary?
   
   I also don't quite understand why the transaction manager didn't expose the 
way to shut down a resource alone. In the method exposed by the 
userTransactionService, he only removed it from the resourceList_ and 
resources_, but did not call its close method, which resulted in the need to 
wait for jvm to collect system garbage. This resource will only be recycled.
   
   The problem that follows is that if I want to dynamically offline a logical 
library and its corresponding transaction manager on the proxy side, I cannot 
disconnect the proxy from mysql in time.


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