spring-data-examples icon indicating copy to clipboard operation
spring-data-examples copied to clipboard

Add Spring Data JDBC How To for Multiple DataSources

Open dmfrey opened this issue 5 months ago • 1 comments

  • [x] You have read the Spring Data contribution guidelines.
  • [x] You use the code formatters provided here and have them applied to your changes. Don’t submit any formatting related changes.
  • [x] You submit test cases (unit or integration tests) that back your changes.
  • [x] You added yourself as author in the headers of the classes you touched. Amend the date range in the Apache license header if needed. For new types, add the license header (copy from another file and set the current year only).

dmfrey avatar Aug 01 '25 16:08 dmfrey

At the moment, Spring Data JDBC isn't ready for prime time with multiple data sources. The repository setup starts breaking apart once using relations (e.g. List<ComplexType>) because the factory bean is being wired without a DataAccessStrategy (also RelationResolver) and the MappingJdbcConverter. We need to fix https://github.com/spring-projects/spring-data-relational/pull/1704 first which introduces consistent configuration through JdbcAggregateOperations for proper routing of entities into the correct data source.

mp911de avatar Aug 04 '25 12:08 mp911de