Hi All pleae clear my doubt. when times out occur for a Bean than as per ejb1.1 ejbRemove()method not called then what other method gets called hear? Ref: EJB ,In O'reilly BOOK.(Mansoon Hafel). Page : 268 (as per Indian Edition)
posted 16 years ago
Hi, I think you mean the section 6.6.3 of the EJB Specification. This says that the ejbRemove() will not be called on an instance in the following scenarios. A timeout of client inactivity while the instance is in the passive state. The timeout is specified by the deployer in an EJB Container implementation specific way. This is specific to an session bean. There is no timeout to an Entity bean( refer lifecycle of an Entity bean at 9.1.4 & ejbRemove( 9.4.3). If you focus your attention to the section which i have stressed by making it Bold i think you will get the answer. The answer lies in the fact that the ejbRemove method the instance typically releases the same resources that it releases in the ejbPassivate method (6.5.1 ejb spec. 1.1) How it effects the client Basically a session Bean services a single client. In a stateless session bean the above act does not affect the client at all as he may be probably given the same, different or a new instance each time he makes a request. However in a stateful session bean a specific single bean is servicing a client and its removal(through timeout) will effect the client and an Exception will be raized.