remove method


EJB design: remove method

  1. remove method (2 messages)


    remove method is in EJBHome and EJBObject what is the difference between them.

    Threaded Messages (2)

  2. remove method[ Go to top ]

    hello freind ,

    through both ways you are able to call the remove method.

    but to call remove method on EJBHome you have to get EntityContext reference which will be in bean class , so you have to invoke this method there with parameter as Primarykeyclass object

    but to call remove method on EJBObject you have to get remote interface reference which you can get in the client class by calling the findByPrimaryKey method on home and call remove with no parameter.

    i told the difference in the way of coding these , but i don't know is there any specific reason in which we have to choose either of the way to remove...

    with regards

  3. remove method[ Go to top ]

    Essentially both are used to remove a session or entity bean.

    For entity beans:
    if u are using EJBHome.remove, u don't call the findByPrimaryKey method, u simply pass the pk object to the remove method.

    if u are using EJBObject.remove, u call the findByPrimaryKey method to retrive a remote interface, u then invoke the remove method of the remote interface.

    i prefer the first approach since u only make one call.