Thank you Nehul AFAIK the container will not call ejbRemove stateful session bean in these cases: 1) a time-out while passivated 2) a system exception in a business method 3) a container crash a call from remove while passivated will be an additional case. Do you know where in the spec I can find this mentioned. Thank you /Magnus
Nehul: I beg to differ on your response here. I have not seen a link from passivated state to Does Not Exist State using the remove method. I assume that the container will first activate the bean before calling ejbRemove() on it. Can you explain further why you think otherwise or why you think that it wont activate the bean fist before removing it, outside the overhead cost of doing this?
Read page 213 from Head First EJB. I am 100% sure it won't call ejbActivate to remove bean if it is in passivation. It will only call ejbActivate if client come back in reasonable time when bean was last passviated. Container has better things to do compare to call ejbActivate just to remove it. So you better put your clean up code in both ejbPassivate & ejbRemove method. Hope this will make my point clear. SCJP1.4 SCWCD [ January 19, 2004: Message edited by: Nehul Nalekar ]
Originally posted by Nehul Nalekar: We don't talk about client remove call to container. We are talking about bean in passivate mode & no call comes from client in reasonable time. In that case no ejbActivation method called.
I think Kathy already did a good work of explanation on this issue of remove so we need not argue further on it. Thanks everyone, Anselm