Bryan Roach wrote:
>
> So, then, what if we are not explicitly setting up different servlet
> contexts, so that our servlets just load into the default context? Are we
> guaranteed that within the default context, we will only get one instance
> of our singleton object?
>
I believe that's what recent-ish versions of the spec
guarantee.
(The default context is not distributable, but if it were,
you'd have to deal with the possibility of multiple jvm's,
each with its own singleton. That might matter for, say,
a connection pool, where the db being connected-to would
have to handle n times the number of connections)
> For the singleton object to be workable, it would seem that you would
> need a guarantee of NOT one for the whole servlet engine, but definitely
> one for each logical servlet context.
>
I can imagine deployment scenarios where it made sense to share
a connection pool globally, but in general I believe you are
correct.
(As before, anybody reading this should definitely either refer
to the spec or ask one of the spec developers before taking any
of it as gospel :-)
-cks
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html