tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shapira, Yoav" <Yoav.Shap...@mpi.com>
Subject RE: Multiple requests sharing the same Servlet instance
Date Mon, 14 Jun 2004 14:52:48 GMT

Hi,
I don't think your understanding is correct: the container may allow
multiple threads to use the same servlet instance concurrently.  If you
need synchronization around or within that method, or around some fields
in your servlet class, you are responsible for it.

The container does guarantee that only one thread will process a request
from start to finish, i.e. the same thread will invoke any filters,
servlets, etc. for the same request.

Yoav Shapira
Millennium Research Informatics


>-----Original Message-----
>From: Keith Hankin [mailto:keithh@addr.com]
>Sent: Monday, June 14, 2004 10:53 AM
>To: Tomcat Users List
>Subject: Multiple requests sharing the same Servlet instance
>
>I am having a problem where one Servlet instance seems to being used by
two
>different threads at the same time. It is my understanding that Servlet
>instances will not be used by two threads at the same time, so that the
>service() method would thus only be called by one thread, then it can
be
>called again if the Servlet instance is reused by way of pooling.




This e-mail, including any attachments, is a confidential business communication, and may
contain information that is confidential, proprietary and/or privileged.  This e-mail is intended
only for the individual(s) to whom it is addressed, and may not be saved, copied, printed,
disclosed or used by anyone else.  If you are not the(an) intended recipient, please immediately
delete this e-mail from your computer system and notify the sender.  Thank you.


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message