[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Sharing persistence between different jar files in ear ?

Interista do-not-reply at jboss.com
Mon Jan 28 04:09:11 EST 2008


Hi,
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?


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4123957#4123957

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4123957



More information about the jboss-user mailing list