Session Facade Call To Entity Bean


EJB design: Session Facade Call To Entity Bean

  1. Session Facade Call To Entity Bean (3 messages)

    I'm implementing the Session Facade pattern. The client will connect to the Session Facade bean and then the session bean will connect to the Entity bean. My question is: Within the session bean, How do you code the call an Entity ?
  2. Hi Kevin,

    Here is code snippet for calling the entity bean.
    You get the entity bean home interface. you can play with it. Assume that calling entity bean is in the same deployed jar file.

    String vBeanName="java:comp/env/ejb/EntityBeanName";
    InitialContext ic = new InitialContext();
    HomeInterface hi = (HomeInterface)ic.lookup(vBeanName);

    Good Luck.
  3. Thanks for the help. I'll give it a try.
  4. It need not be in the same jar if u r using EJB 2.0
    U can assign the CLASSPATH(pointing the concerned jar) variable in the manifest file.