-
1. Re: New scoping of EntityManager and SessionBeans
dornus Jan 31, 2006 3:34 PM (in response to jajansen)I agree 100%
-
2. Re: New scoping of EntityManager and SessionBeans
bill.burke Jan 31, 2006 5:09 PM (in response to jajansen)Scoping is spec mandated, nothing we can do about it. In fact, I'm not even sure you can legally reference a PU packaged within an EJB-JAR with the "../foo.jar#PU" syntax. Repackage your persistence units into their own jar separate from EJBs and you don't have to use that ugly syntax.
As for the EJB default JNDI names? Yes, I liked the old syntax too but it didn't work well out of the box when you use the same interface name in multiple EJBs or versioned the EJB in different EARs. If you think about it, the EAR syntax is analogous to the WAR file name being used as the root context in a URL. If you don't like the default names, you can change it in jboss.xml or with the @Remote/@LocalBinding annotations. -
3. Re: New scoping of EntityManager and SessionBeans
jajansen Feb 1, 2006 7:15 AM (in response to jajansen)Bill, I understand your point on the scoping being spec mandated. But the spec is not final yet, I believe, so do you think that this should be repared in the final spec? Or do you see benifits of scoping to the JAR instead of the EAR level?
Your suggestion on repacking sound a lot like what I've done in my project (a core.jar that contains the EJBs and a domain.jar that contains the PersistenceUnit and the entity beans. The PU is scoped to the domain.jar so in the domain.jar I'm fine. But the EJB package also needs to reference the PU and then I need to scope it to the domain.jar, right? Or am I missing something?
Best regards,
Jan Arend Jansen -
4. Re: New scoping of EntityManager and SessionBeans
bill.burke Feb 1, 2006 10:22 AM (in response to jajansen)"jajansen" wrote:
Bill, I understand your point on the scoping being spec mandated. But the spec is not final yet, I believe, so do you think that this should be repared in the final spec? Or do you see benifits of scoping to the JAR instead of the EAR level?
Well, EJB-JAR classes may be isolated. Also, EJB-JARs may be developed separately and maybe contain the same persistence unit names. Same goes with pu's deployed within a WAR. A WAR is *definately* isolated from all other EJBs and WARs. In JBoss, EJB jars are not deployed in an isolated classloader, so this point is moot, but this may not be the same in other app servers.Your suggestion on repacking sound a lot like what I've done in my project (a core.jar that contains the EJBs and a domain.jar that contains the PersistenceUnit and the entity beans. The PU is scoped to the domain.jar so in the domain.jar I'm fine. But the EJB package also needs to reference the PU and then I need to scope it to the domain.jar, right? Or am I missing something? Best regards, Jan Arend Jansen
-
5. Re: New scoping of EntityManager and SessionBeans
jajansen Feb 1, 2006 11:41 AM (in response to jajansen)Ok, guess I have to live with it then ;-)
Thanks for the elaboration.