Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • 5
    This must be the accepted answer. I made a mistake like this, created the transactionManager bean but forget to add the transactionManagerRef on @EnableJpaRepositories annotation. The application was able to read the datasources registries, but unable to save new entities. Commented Feb 18, 2019 at 13:33
  • 1
    In my case, my problem is that I created PlatformTransactionManager bean by new DataSourceTransactionManager(getDataSource()), It seems BasicDataSourceTransactionManager just does not work well with spring jpa(I used spring boot2 starter which bring in spring-data-jpa:2.0.12 ). Replacing it by new JpaTransactionManager solved my problem Commented Mar 15, 2019 at 8:47
  • 1
    Didn't knew that two different TMs are required when connecting to different databases. This is really helpful. Commented Aug 16, 2019 at 10:57