posted 20 years ago
both ejbPassivate and ejbRemove will be called by container. But the intention of the call is different. In entity bean, ejbPassivate will put the bean back to the pool. In stateful session bean, ejbPassivate will put the bean to secondary storage. In stateless session bean, ejbPassivate will not be allowed.
In entity bean, ejbRemove will also remove the bean from data source and put the instance back to instance pool. In stateful session bean, ejbRemove will remove the bean instance and client can no longer call the methods of this bean, and in stateless session bean, ejbRemove will remove the bean but put it back to instace pool and client does not know that this bean is removed and if they call another method of the bean, a different instance will be picked from the pool to service the client.
Hope this helps,
Cheers,