Tables not getting created in multiple databases in spring boot application

后端 未结 3 1297
再見小時候
再見小時候 2020-12-29 09:41

I am working on spring boot multi tenancy application. I have configured multi datasources as shown below :

application.properties

spring.multitenanc         


        
3条回答
  •  [愿得一人]
    2020-12-29 10:03

    You need 2 different persistence factories, not one, each should produce different EntityManagers for different datasources. Also each entity mapping should be marked to been used only with one entity manager. See full solution here:

    http://www.baeldung.com/spring-data-jpa-multiple-databases

提交回复
热议问题