Files
spring-data-examples/jpa/multiple-datasources
Oliver Gierke 4164bc4607 #297 - Upgraded to Boot 2.0 and Spring Data Kay.
Bumped version number to 2.0. Upgraded to Spring Boot 2.0.

Stuff disabled in the meantime:

- Cassandra: needs API adaptions in configuration
- JPA > Security: test fails with weird Hibernate error
- Redis > Reactive: API updates needed
- Solr: configration updates necessary

adjust versions

Updated elastic search to the new version.

Fixed the reactor version to Bismuth-BUILD-SNAPSHOT. This probably should be undone when boot references the proper bom.
2017-10-06 15:15:53 +02:00
..
2017-08-24 11:54:24 +02:00
2016-03-04 07:50:26 +01:00

Spring Data JPA - Multiple datasources example

This project contains an example of how to set up Spring Data to work with two independent databases. Note, that this example is not about JTA transactions spanning multiple databases but rather just interacting with separate databases through a cleanly separated domain model and Spring Data repositories.

Interesting points to look at

To connect to two databases we need to manually configure a DataSource, EntityManagerFactory and JpaTransactionManager. This is done in CustomerConfig and OrderConfig. DataInitializer then simulates a Spring component interacting with those databases in separate methods. Application.init() orchestrates calls to those methods.