Howdy,
There are two little points I wanted to make here...
1) Passivation and timeout
These two are really separated as far as the Container is concerned. Passivation is often determined by available resources, so you might want to configure your server by saying, "Don't passivate until you REALLY need to because RAM is low, but DO timeout after [some number] has passed without any activity..."
So you could easily have scenarios where your beans can timeout, but they are in an active state as long as they're alive. You might want this for better performance.
2) ejbRemove() and passivation. This one is a little confusing because of the way the spec is written, but here it is:
* If the bean times out when passivated, the Container kills it without calling ejbRemove(). It makes an assumption that it isn't worth it, especially since it means this client has abandoned the service.
* BUT... if the client calls remove(), the bean WILL be brought back out of passivation. The reason that this is confusing in the spec is because they use the
word "business method", and the spec often uses "business methods" to include many of the methods exposed in the interaces including create and remove. So, when the client calls remove(), and the bean is passivated, the Container treats the call as a business method and wakes the bean up to run it. It assumes that there may be something specific to closing out this session with the client, and since the client is obviously still involved with the session.
So, a bean will NOT be destroyed automatically when the client calls remove() and the bean is passivated. The bean will be activated, and then removed. This isn't really obvious in the spec, though, so it's easy to miss.
=================
cheers,
Kathy