Why there has a method called unsetEntityContext() in EntityBean interface but not has a corresponding method called unsetSessionContext() in SessionBean interface?
ejbRemove() is called for session beans every time the container destroyes the bean. So you can use this method to do the stuff you typically would do in unsetEntityContext().
For entity beans ejbRemove() is only called if the user explicitly deletes the bean. I think that is the reason why the engineers at SUN invented the unsetEntityContext() for this kind of bean.
so if you implement a unsetSessionContext() inside the session bean it will never be called.
yes, if you write unsetSessionContext() inside the session bean it will never be called because it is not a callback method for session beans.