From 47afca01758e2871899607f976e47813d9ad9606 Mon Sep 17 00:00:00 2001 From: Niclas Fredriksson Date: Tue, 23 Oct 2018 06:13:45 +0200 Subject: [PATCH] Enhance multiple entity manager factories online documentation. Fixes gh-14642 --- .../spring-boot-docs/src/main/asciidoc/howto.adoc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/howto.adoc b/spring-boot-project/spring-boot-docs/src/main/asciidoc/howto.adoc index 773c1eb3f0ac..84d84c715a56 100644 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/howto.adoc +++ b/spring-boot-project/spring-boot-docs/src/main/asciidoc/howto.adoc @@ -2037,12 +2037,12 @@ entity manager in the presence of a bean of that type. -[[howto-use-two-entity-managers]] -=== Use Two EntityManagers -Even if the default `EntityManagerFactory` works fine, you need to define a new one. -Otherwise, the presence of the second bean of that type switches off the -default. To make it easy to do, you can use the convenient `EntityManagerBuilder` -provided by Spring Boot. Alternatively, you can just the +[[howto-use-multiple-entity-managers]] +=== Using Multiple EntityManagerFactories +Sometimes you may wish to work with multiple Entity Manager Factories, because you have +multiple data sources. In those cases, you need to create your own `EntityManagerFactory` +for each datasource. To make it easy to do, you can use the convenient `EntityManagerBuilder` +provided by Spring Boot. Alternatively, you can just use the `LocalContainerEntityManagerFactoryBean` directly from Spring ORM, as shown in the following example: