[jboss-user] [EJB 3.0] - EntityManager through JNDI: Is it container managed?
do-not-reply at jboss.com
Fri Jun 26 05:46:30 EDT 2009
I'm starting a development that will be deployed into JBoss. I'm trying to reuse a bunch of classes I'm currently using in a J2SE application. These classes do already use JPA and get EntityManager through a JNDI lookup.
I don't want to convert them into EJB so I can keep reusing them.
I have successfully obtained EntityManager through JNDI from within JBoss by adding the following line into "persistence.xml" file:
<property name="jboss.entity.manager.jndi.name" value="java:/persistence/FondosEJB" />
Just to make sure I'm getting the right EntityManager, I've System.out.println'ed both the injected one and the one I retrieve via JNDI... and they're not the same!!!
Is this ok? Or does it mean that the one I get through JNDI isn't container managed or something?
Thanks a lot for your help.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4240265#4240265
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4240265
More information about the jboss-user