[jboss-user] [EJB 3.0] - Re: Single persistence.xml file with multiple EJB jars

jaikiran do-not-reply at jboss.com
Thu Mar 27 11:49:18 EDT 2008


Can you give us a bit more specific example of your case? You mentioned you have 2 ejb jars msp1_ejb.jar and msp2_ejb.jar which are trying to use a the same persistence unit. If i understand your scenario right, you could have something like this:

  | msp.ear
  |  |
  |  |--- META-INF
  |  |	|
  |  |	|-- application.xml
  |  |
  |  |
  |  |--- mypersistence.jar
  |  |	|
  |  |	|--- META-INF
  |  |	|	|
  |  |	|	|--- persistence.xml
  |  |	|	
  |  |	|--- <entities>
  |  |	
  |  |
  |  |--- msp1_ejb.jar
  |  |
  |  |--- msp2_ejb.jar
  |  
  | 
And in the EJBs in the msp1_ejb.jar and msp2_ejb.jar, you could inject the persistence context as follows:

  | @PersistenceContext (unitName="mypersistence.jar#msp-par")
  | private EntityManager manager;	

Let us know, if i did not understand your scenario right.


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

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



More information about the jboss-user mailing list