How is remote stateless session EJB removed, if clients don't remove() it
I've seen code that doesn't call .remove, and Sun's tutorial also doesn't .remove(), despite the fact that the create() call is made:
http://java.sun.com/j2ee/1.4/docs/tutorial/doc/EJB4.html#wp79902
My questions are:
1. .create() instantiates a new remote instance, doesn't it?
2. since clients don't call .remove(), how does the remote instance get ejbRemove()d?
2.1. Does perhaps the home instance of such ejb cause removal upon finalize()? I've seen some auto-generated EJB stubs, but i don't see that being the case.
[565 byte] By [
safira] at [2007-11-26 15:39:04]

# 1
Clients do have the option of calling remove() but the behavior depends on the kind of
session bean.
For stateless session beans, calling remove() doesn't have much value since the lifetime
of the bean instances in the container is decoupled from the client. An ejb container
is free to use the remove call as a hint, but in general the container will clean up instances
when it deems it necessary. Most implementations define a number of configuration
parameters to control this, e.g., max-pool-size.
For stateful session beans, calling remove() will indeed remove that session bean identity,
whether it's in memory or it has been passivated.Even in the absence of an explicit
client call to remove(), the container is still free to remove a stateful session bean.
Most implementations define a set of timeout parameters that control this behavior.
--ken