Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance multiple entity manager factories online documentation #14928

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down