0 Replies Latest reply on Feb 16, 2006 5:50 PM by knifegun

    4.0.4RC1/EJB 3.0 / Lazy Fetch / Entity Manager

    knifegun Newbie

      I have been wrestling with trying to use LAZY fetch for my EJB3s. I have a seperately deployed *.ejb3 file with my EJBs. I have another WAR file that needs to access the EJBs. I have LAZY fetch turned on the EJBs. After doing a bunch of research, I read posts indicating that you cannot use Lazy fetch in the WAR context unless you create a local version of the entity manager.

      So I did that and I still get the issue. I have a builder in the WAR file that successfully creates an instance of EntityManager through the EntityManagerFactory available through JNDI. When I call a function in the EJB that queries for child table entries, I get the detached entity exception.

      I have followed all the steps including updating the persistence.xml file to the new 4.0.4RC1 format and included the jndi parameters for the EntityManagerFactory.

      At this point, I am not sure what to do to get this working. Any help would be greatly appreciated.

      Has anyone gotten Lazy fetch working when accessing EJB 3.0 beans in a WAR?

      For more details, please reference: http://www.jboss.com/index.html?module=bb&op=viewtopic&t=77329

      Thanks in advance.