linghengqian commented on issue #28704: URL: https://github.com/apache/shardingsphere/issues/28704#issuecomment-1756627397
> > * late reply. I won't have time to confirm the real problem until tomorrow. This seems to be related to some issues on the ShardingSphere JDBC 5.4.1 milestone. > > SpringBoot seems to have no DataSource management in ShardingSphere-jdbc 5.3.2。 How to obtain the DataSource object when adjusting the configuration reading of the Driver to the SPI interface in ShardingSphere-jdbc 5.3.2 ? But can we refresh the table rule actualDataNodes by obtaining the dataSource? - You must consider that ShardingSphere JDBC 5.3.2 refactors the upstream and downstream ContextManager for SPI extensions to third-party metadata centers. - I wrote an article at https://github.com/apache/shardingsphere/discussions/12258#discussioncomment-3917927, which mentioned how to get the real ShardingSphereDataSource to use ContextManager on ShardingSphere JDBC 5.3.2, which You need to actively define a Spring Bean. I am trying to help the downstream understand from a beginner's perspective how ContextManager serves dynamic update requirements like DistSQL. - This article also mentions how to obtain the ContextManager through Connection when configuring through JDBC Driver. But not long after I noticed that this particular example had a bug at https://github.com/linghengqian/shardingsphere-contextmanager-explore/issues/3. I haven't figured out how to fix it yet -- even though I'm a ShardingSphere Committer, I have my knowledge blind spots because the master branch's unit tests change very frequently. - I plan to refactor this article in the foreseeable future and include Examples for ShardingSphere JDBC 5.4.0 and 5.4.1. This TODO is documented at https://www.yuque.com/linghengqian/meve2v/ykridze9nguvect5 . Considering that I'm a graduating college student, finding time is difficult for me. - As a warning, I definitely don't think you should inject any Spring Beans into the algorithmic class implementation of ShardingSphere SPI, which conflicts with the definition of DistSQL. Because the algorithm class must actually be the final class, DistSQL can remove and recreate the algorithm class. - As a further extension, I exposed the Row Value Expressions SPI at https://github.com/apache/shardingsphere/issues/22899. This allows for a more flexible way of defining ActualDataNodes. This feature is on the pre-release branch of ShardingSphere 5.4.1. -- 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: notifications-unsubscr...@shardingsphere.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org