Skip to content

How to obtain underlying real data sources in SpringBoot when using ShardingSphere? #36904

@strcpy-s

Description

@strcpy-s

I've noticed that all real data sources defined in the YAML configuration are instantiated and wrapped into a ShardingSphereDataSource, which is then stored in ShardingSphereDriver. DriverDataSourceCache. However, this entire process happens outside of Spring Boot's control. As a result, these actual data source instances are not managed by the Spring container, making them inaccessible via standard Spring dependency injection.

So my question is: Is there a recommended way to access these real data sources from within the Spring application context? Or can we make them Spring-managed?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions