-
1. Re: Annotating @persistencecontext from a different ear
erili May 4, 2009 10:18 AM (in response to erili)Sorry, I forgot to add I'm using JBoss 4.2.2GA
-
2. Re: Annotating @persistencecontext from a different ear
jaikiran May 4, 2009 10:21 AM (in response to erili)As far as i remember, the persistence units in different EARs are not accessible from the other EAR.
-
3. Re: Annotating @persistencecontext from a different ear
erili May 5, 2009 10:03 AM (in response to erili)Ok.
Then I'll have to figure out a different solution. The bbb-ear is a large application with slow release cycles. I'm developing a maintenance application (aaa.ear) that deploys as a stateless EJB that can pull entities from the main application and send data from them to a client through JMX. So the ejb in aaa.ear need to access some entities in bbb and it would be really nice if this could be done through the same persistence context that the main application is using.
This would allow the maintenance guys to hot deploy the hook ear, run some batch jobs and whatnot and undeploy it without having to clutter the main application.
I guess I could connect directly to the datasource, but then the cache would be bypassed and only reads would be possible.
Am I trying to do something impossible? Are there any other approaches I should look into? I'm very new to JavaEE, I hope I'm not asking dumb questions.. Oh, the shame..! :-) -
4. Re: Annotating @persistencecontext from a different ear
erili May 8, 2009 3:47 AM (in response to erili)What I did to solve my problem was to get the product development team to add a new session bean in the main product that is injected with a entity manager and a getEntityManager method that the aaa.ear ejb can call.