linghengqian commented on code in PR #7559:
URL: https://github.com/apache/incubator-seata/pull/7559#discussion_r2280146978
##########
rm-datasource/src/main/java/org/apache/seata/rm/datasource/sql/struct/TableMetaCacheFactory.java:
##########
@@ -108,7 +108,19 @@ private static void removeHolderFromMap(String resourceId)
{
LOGGER.info("Removed TableMetaRefreshHolder for resourceId: {}",
resourceId);
}
+ /**
+ * Shutdown all TableMetaRefreshHolder threads.
+ */
+ public static void shutdown() {
Review Comment:
> When registering itself with the Seata-Server (TC), I believe that
`DataSourceProxy` should proxy the `close` method. Upon closing, it should
remove itself from both `DefaultResourceManager` and `TableMetaCacheFactory`.
Currently, `TableMetaCacheFactory#removeHolderFromMap` is executed
passively—only when refreshing table metadata encounters an exception due to a
closed datasource does the removal occur. This approach, however, feels
inelegant.
- Out of curiosity, I don't seem to see any class that actually implements
`org.apache.seata.core.model.ResourceManager#unregisterResource(org.apache.seata.core.model.Resource)`.
```shell
org.apache.seata.common.exception.NotSupportYetException: unregister a
resource
at
org.apache.seata.rm.datasource.DataSourceManager.unregisterResource(DataSourceManager.java:96)
at
org.apache.seata.rm.DefaultResourceManager.unregisterResource(DefaultResourceManager.java:125)
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]