0 Replies Latest reply on Apr 1, 2013 9:46 AM by kkkppp

    [Jboss 7.1.3] Exception thrown when invoking getEJBHome

    kkkppp

      Basically code looks like this

       

      entity.remove();

      ...

      entity.getEBHome();

       

      and exception is

       

      17:28:26,730 ERROR [org.jboss.as.ejb3.invocation] (http-127.0.0.1/127.0.0.1:8080-91) JBAS014134: EJB Invocation failed on component SWGroups for method public abstract javax.ejb.EJBHome javax.ejb.EJBObject.getEJBHome() throws java.rmi.RemoteException: javax.ejb.NoSuchEntityException: Can't find DB record in ejbLoad() for SWGroups, PK = SWGroupsPK@99920

       

      The problem is that EntityBeanAssociatingInterceptor is trying to get entity instance even if method not going to return any instance-related data so execution fails before EntityGetHomeInterceptorFactory

       

      I'm planning to skip instance retrieval if context.getMethod is either getEJBHome or getEJBLocalHome, but not sure what is the goal of

       

                      instance.getComponent().getCache().release(instance, true);

       

      in EntityGetHomeInterceptorFactory. Does it mean that this interceptor is always last one in chain? If so, I guess I can skip this release() call for already removed entity?