This was the answer Provided by some one... According to Mohan this one is not correct. Please see Mohan's reply below and more in the comments section.
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.
Answer posted by Mohan on 2005-05-21 19:32:46:
[Quote] 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. [Quote]
Who ever wrote this is wrong there is a difference between the ejbRemove and unsetEntityContext.. the difference is when ejbRemove is fired the bean is returned back to the instance pool .. at this point the bean is not associated with any client and it does not represent any data .. when the container calls the unsetEntityContext the bean is removed from the instance pool ...
With EJB 1.1 specs, why is unsetSessionContext() not provided in Session Beans, like unsetEntityContext() in Entity Beans
This was the answer Provided by some one... According to Mohan this one is not correct. Please see Mohan's reply below and more in the comments section.
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.
Answer posted by Mohan on 2005-05-21 19:32:46:
[Quote] 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. [Quote]
Who ever wrote this is wrong there is a difference between the ejbRemove and unsetEntityContext.. the difference is when ejbRemove is fired the bean is returned back to the instance pool .. at this point the bean is not associated with any client and it does not represent any data .. when the container calls the unsetEntityContext the bean is removed from the instance pool ...
Related Answered Questions
Related Open Questions