Assaf Arkin wrote:
> > The way we've read the EJB specification, a client which has obtained a
> > reference to a session bean (lookup + create) should be able to use that
> > very reference for at least the duration of the bean's session timeout.
> > After that time, it is probably "implementation defined" whether a new
> > reference must be obtained (by a new create or handle resolve) or whether
> > the original reference is still usable (and for how long).
> Session timeout applies to stateful session beans which exist for as
> long as you keep using them, or they are passivated (the timeout).
>
> Stateless session beans do not exist until you call them and only for
> the duration of the method call. You'll find the distinction on pages
> 67/68 of the EJB specs.
What I was referring to was the validity of the *client reference* to the
stateless session bean. The specification is not clear about the rules for
this. You're right that from the point of view of a client, stateless
session beans have an indeterminate physical lifespan. But the objects and
resources (such as IIOP connections, POAs, servants, etc) which enable a
client to communicate with the bean instance(s) that provide service are
not free, not necessarily trivial to establish, and not typically cheap to
retain for indeterminate periods of time. It isn't just bean instances that
need to be managed as resources. An EJB server has to be able to limit the
validity of the references (stubs) it hands out, so as to optimally
allocate and share the various server resources needed to support them.
A client reference to a stateless session bean - obtained via a home lookup
and subsequent create - ought to be good for some period of time. "Session
timeout" seems like a good time interval specifier. But after that time,
the reference should be cancellable, after which the client must either
resolve a handle, "create" a new reference, or look up the home and
"create" again.
Marc San Soucie
GemStone Systems, Inc.
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".