How to implement multiple datasource configurations in spring-boot?

Viewed 64

We are moving our application to Spring Boot and one of the problems we would like to solve is managing multiple EntityManager/DAOs. I've read about multi-tenancy implementations in Spring but they all seem to rely on having at least one connection at startup.

Our application starts with no connection/EntityManager instantiated, and only when a request is sent through the endpoint /start with the database parameters we instantiate it. We can also have multiple database connections that are stored in a map with an ID as key.

Is it possible to implement something like this in Spring? Is it possible to have Spring manage all the persistence parameters that are created dynamically?

0 Answers
Related