@EnableJpaRepositories 不适用于 JPA 数据存储库
@EnableJpaRepositories will not work with JPA Data repository
我正在尝试 运行 Spring 使用两个数据源启动。到目前为止一切顺利,但是当我尝试使用 Spring JPA 数据时出现了问题。 SimpleJPARepository 不反映
设置的事务管理器
@EnableJpaRepositories(
basePackages = "cz.data.external",
entityManagerFactoryRef = "externalEntityManagerFactory",
transactionManagerRef = "externalTransactionManager")
它似乎仍然使用标记为主要的那个。
javadoc 说
transactionManagerRef - Configures the name of the {@link PlatformTransactionManager} bean definition to be used to create repositories discovered through this annotation.
是我做错了什么还是 Data JPA 不支持它?更改事务管理器。
您是不是无意中使用了 Spring 4.1.4?您似乎 运行 this regression。我们建议使用 Spring 4.1.3(在引导项目的情况下通过显式设置 spring.version
属性)直到 4.1.5 发布。
我正在尝试 运行 Spring 使用两个数据源启动。到目前为止一切顺利,但是当我尝试使用 Spring JPA 数据时出现了问题。 SimpleJPARepository 不反映
设置的事务管理器@EnableJpaRepositories(
basePackages = "cz.data.external",
entityManagerFactoryRef = "externalEntityManagerFactory",
transactionManagerRef = "externalTransactionManager")
它似乎仍然使用标记为主要的那个。 javadoc 说
transactionManagerRef - Configures the name of the {@link PlatformTransactionManager} bean definition to be used to create repositories discovered through this annotation.
是我做错了什么还是 Data JPA 不支持它?更改事务管理器。
您是不是无意中使用了 Spring 4.1.4?您似乎 运行 this regression。我们建议使用 Spring 4.1.3(在引导项目的情况下通过显式设置 spring.version
属性)直到 4.1.5 发布。