users@glassfish.java.net

Re: Putting EntityManagerFactory into JNDI

From: <glassfish_at_javadesktop.org>
Date: Wed, 23 Jan 2008 10:39:18 PST

> Sure, but since I can't predict which EJB the call
> will come through, this means that *every single* EJB
> in my app will have to be mindlessly annotated with a
> @PersistenceUnit, and this is exactly the thing I'd
> like to avoid.

Yea, that's a real problem IMHO. It makes it difficult to write EJB library/utility code. I'd like to see a solution to this issue as well.

But I guess this is no different from having to toss in a EJB Resource tag in to the ejb.xml, right?

One of the trademarks of EJB is that each component has it's own environment. That, in theory, is what makes the EJB components portable and deployable.

This is also a conflict between the local and global EJB name spaces. For example, Local Session beans are not in the global JNDI (they need to be put their via the annotation to be looked up) whereas Remote session beans are TRULY global to the CONTAINER. But there should be some kind of "local global" space that wraps up the components within an EAR so we don't have to annotate each bean within the Session bean through which the call enters.

Is there a way to set that kind of thing up, once, at the EAR level?
[Message sent by forum member 'whartung' (whartung)]

http://forums.java.net/jive/thread.jspa?messageID=255421