Anyone aware of an implementation of SessionBroker on top of JPA or Hibernate API?


I mean by SessionBroker, an encapsulation of the fact that 2 EntityManager potentially pointing to 2 different databases are involved. So that the client is coded like just one EntityManager is used. Similar to:


This is having for constraint that each EntityManager do not reference the same classes so that query like below can be redirected to the right EntityManager transparently because can lookup the right EntityManager using the class: