Spring Boot with 2 database configs - lazy loading with second config does not work
问题 I have Spring Boot project with 2 database configs. Primary DB config: @Configuration @EnableTransactionManagement @EnableJpaRepositories(transactionManagerRef = "primaryTransactionManager", entityManagerFactoryRef = "primaryEntityManagerFactory", basePackages = { "com.example.repository.primary" }) public class PrimaryDbConfig { @Primary @Bean(name = "primaryDataSource") @ConfigurationProperties(prefix = "spring.primary.datasource") public DataSource dataSource() { return DataSourceBuilder