tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Blevins <>
Subject Re: Lookup EntityManager from Stateless EJB Session Bean
Date Thu, 30 Jul 2009 23:27:35 GMT

On Jul 28, 2009, at 1:44 PM, Chan Kelwin Hillary wrote:

> I have a stateless EJB Session bean that successfully instantiates the
> EntityManger using the @PersistenceContext annotation.

Not commonly seen or known, but all dependency injection annotations  
can actually be used to configure lookup strings as well.  Here's a  
doc that shows the usage of @Resource on a class and the xml that the  
annotation implies:

The same thing can be done with @PersistenceContext, @PersistenceUnit,  
@EJB and so on.  Just added an equivalent page for you that shows it:


View raw message