[jboss-user] [EJB 3.0] - Re: How to get EnitityManager in SLSB without injection??

ALRubinger do-not-reply at jboss.com
Tue Dec 12 16:34:14 EST 2006


You can just load the EM, no need to go through the factory.

I've always done the lookup into an instance variable via resource injection:
@Resource(mappedName="theJNDINameOfEM")
  | private EntityManager em;

I believe you shouldn't have to register the EM with the transaction; the container should be doing it for you (it has in all cases I've experienced).

S,
ALR

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3993179#3993179

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3993179



More information about the jboss-user mailing list