Hi Scott,

> Technically, the persistence.xml scanning does not automatically  
> populate JNDI with the EntityManager.  It populates an app-server  
> dependent space (in Resin it's WebBeans) that's available for  
> injection using @PersistenceUnit and @PersistenceContext.

the wiki on http://wiki.caucho.com/Amber:_EntityManagerFactory says:

--
In Amber, the EntityManagerFactory for a persistence unit is stored as
"java:comp/env/persistence/PersistenceUnit/xxx", where "xxx" is the name of the
persistence unit.
--

> If you have a @PersistenceUnit or @PersistenceContext (or <persistence- 
> unit> or <persistence-context> in your web.xml), those declarations  
> populate the JNDI space with their JNDI name.  So you're technically  
> missing a JNDI linking step.

Could you give me an example on how to configure this with xml? All I got to
work with resin-xml is <ejb-server> - which doesn't allow that keyword.

> Personally, I'd stick with the injection annotations when possible and  
> avoid JNDI, since JNDI is really a previous-technology solution.

@PersistenceUnit isn't injected in my JPA managing class - which I use to also
be able to run the application in a non-j2ee environment. That leaves me only
the option to get it somehow from the context.

Best regards, --- Jan.



_______________________________________________
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest

Reply via email to