Christopher Schultz wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
David,
David Smith wrote:
As I understand it one instance of the servlet per webapp is accessed
from all threads in a reentrant manner. This is why you normally can't
use any class instance variables in a servlet.
While this is the most straightforward implementation of a servlet
container, the servlet specification makes no guarantees whatsoever
about the lifecycle of a specific servlet. The container is free to
create a new instance of the servlet to handle every request, or to keep
a single copy around for the life of the webapp. Or anything in between.
Yup.... and all the more reason to store this synchronized data object
in the servlet context, implementing logic to make it thread-safe.
The only guarantee made along these lines is for servlets that implement
SingleThreadModel, which will either require serialized access or
multiple instances to handle requests. Since this has been deprecated
but not removed from the spec, I'll bet it will continue to be supported
forever, but it's not a very good idea IMO.
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFG+64J9CaO5/Lv0PARAjpoAJ0WrN71Y3DsZMwsH3Id7yyVw7eSNgCgwenS
7F7lp0R5RGdDyYeopo6oQO4=
=Ki+D
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]