5 Replies Latest reply on Apr 17, 2007 9:20 AM by fhh

    EntityManager available outside container ?

    Guillaume Basilico Newbie

      Hello,
      We are planning to migrate an application from EJB 2.1 to EJB3. Our application currently uses CMP entity bean and the client side is a SWT application (no servlet, no jsp). So in order to replace my old CMP i wanted to use the new persistence layer.

      My problem is that i'm trying to access an EntityManager outside the EJB container (see my other post here : http://www.jboss.com/index.html?module=bb&op=viewtopic&t=106320).
      After reading some articles, i found that EntityManager may not be accessible from outside the container (after adding a "jboss.entity.manager.jndi.name" property in my persistence.xml, i'm trying to get it from a jndi lookup but it returns null).

      So my question is : what is true ? Is it possible to access the entitymanager this way ? Or is it mandatory to use a session bean (with dependency injection of the EntityManager) to access it from the client side ?

      Thanks in advance.
      Regards,

      Guillaume Basilico