Interview Questions

Why do we have a remove method in both EJBHome and EJBObject?

EJB Interview Questions and Answers


(Continued from previous question...)

31. Why do we have a remove method in both EJBHome and EJBObject?

With the EJBHome version of the remove, you are able to delete an entity bean without first instantiating it (you can provide a PrimaryKey object as a parameter to the remove method). The home version only works for entity beans. On the other hand, the Remote interface version works on an entity bean that you have already instantiated. In addition, the remote version also works on session beans (stateless and stateful) to inform the container of your loss of interest in this bean.

(Continued on next question...)

Other Interview Questions