JPA dynamic persistence unit name

后端 未结 4 816
长发绾君心
长发绾君心 2021-02-04 06:17

I need a way to dynamically specify the persistence unit in a EJB.

Simplified example:

I have an application using multiple databases as data stores. Each of th

4条回答
  •  时光取名叫无心
    2021-02-04 06:29

    This probably is of no help to solve the problem, but you may like to know that this kind of problems is being discussed for the implementation of JPA 2.1

    This sounds like one of those cases of multitenancy:

    Proposal for Multitenancy Support in JPA 2.1 JSR-338

提交回复
热议问题