Theodore1965 commented on issue #6731: URL: https://github.com/apache/incubator-seata/issues/6731#issuecomment-2268282250
> 一个比较简单的方案,如果你是spring的应用, `DefaultCommonFenceHandler.get().setFenceHandler(new SpringFenceHandler());` 将上面的`SpringFenceHandler`包装后,用你的动态数据源处理后,再执行`SpringFenceHandler`的逻辑,或者你直接继承`SpringFenceHandler`进行处理动态数据源的逻辑 如果你不是spring的应用,你也可以通过这个api,自行扩展一个`FenceHandler`,再应用启动时第一时间进入`DefaultCommonFenceHandler`中 > > 如果您使用 Spring 应用程序,那么一个简单的方法: > > `DefaultCommonFenceHandler.get().setFenceHandler(new SpringFenceHandler());` 用动态数据源处理包装后`SpringFenceHandler`,继续执行 SpringFenceHandler 的逻辑。或者,您可以`SpringFenceHandler`直接扩展以合并动态数据源逻辑。 > > 对于不使用 Spring 的应用程序,您还可以通过独立扩展并在启动时`FenceHandler`将其放入来扩展此 API。`DefaultCommonFenceHandler` 我看到SpringFenceHandler是2.0版本的,我用的是1.7.1,用TCCFenceHandler可以么, 1.7.1版本能否提供个关键代码部分的demo,万分感谢! -- 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]
