how to call session bean to communicate entity bean

Discussions

EJB design: how to call session bean to communicate entity bean

  1. hi,

    I want to know how to call entity bean via session bean
    it is required for me in my small project .

    give me some description what code should i write
  2. Do a look up for the JNDI name of the entity bean from the session bean ..... get the home and then call create to get the remote and.....
    HTH
    Sahil
  3. for look up the home

    thePersonHome = (PersonHome) ctx.lookup("personexample.PersonHome");


    then call to get a remote .... ,as u want to defined ur methods ,just call like

    Person existingPerson = thePersonHome.findByPrimaryKey( new PersonPK(potentialID) );
    if (existingPerson == null) {
     return thePersonHome.create(potentialID, ..., ...,...);


     now enjoy ur project
                  Rajeev