0 Replies Latest reply on Jun 18, 2009 6:26 AM by gonorrhea

    support for four-part naming convention

    gonorrhea

      assume we need to write a HQL or JPQL query that reads from two db servers:


      [server1].[db1].[dbo].[myTable1]

      [server2].[db2].[dbo].[myTable2]


      Is it possible to write such a query using SMPC and JPA/Hibernate as persistence provider?  I have a feeling not, because each EntityManager instance is based on a single datasource, which in turn is based on a single db in a single server.


      So how do you guys handle these situations?  Resort to native queries with JPQL createNativeQuery method or stored procs?