4 Replies Latest reply on Mar 27, 2008 8:29 AM by Dean Pullen

    Sharing persistence between different jar files in ear ?

    tranquillizer Newbie

      imagine that you have an ear project containing one business/db jar, one gui-layer jar and a gui-war.
      The business jar contains business operations and database access.

      But from the gui jar you dont want to use the business jar for standard operations such as entityManager.persist(object), it will just be delegating between layers and that feels not very optimized. So from the gui jar you might want to have a direct handle to the entityManager to do basic operations like save/load/update/find.

      So, how to share the same persistence between the two jars in best way?

      One possible solution is of course to have two persistence.xml in each jar-file, but is there a better way? I have tried to just put the persistence.xml in the ear\META-INF but that doesn't seem to be the right way, or maybe I missed something?