0 Replies Latest reply on Nov 6, 2017 3:43 PM by Jørund Vier Skriubakken

    Possible to access EntityManagerFactory from another deployment?

    Jørund Vier Skriubakken Newbie

      Hi all!

       

      I'm having an application consisting of two sub applications, one "engine", an ejb deployment inside an ear and an admin console, deployed as a war. Both sub applications depends on the same DAO layer (maven module with entities and a persistence unit).

       

      From the admin console application (an SPA) I want to monitor the the stats from Hibernate's Statistics interface, which I get from unwrapping the EnitityManagerFactory to a SessionFactory which finally gives me access to the Statistics interface.

       

      However, as I understand from experience these stats only reflects what's happened in my war-application and not in my ear-application. Is there a way to access the EntityManagerFactory/SessionFactory residing in the ear-application from the war-application? (Take into account that they are deployed in the same server/server-group). Or is my only way through embedding a war with a rest-api exposing the same info within the ear-application? Or will I even meet the same fate there, not able to access the EntityManagerFactory within the ejb from the war?

       

      Any hopes for access it more more or less directly?

       

      Thanks!

       

      Jørund