On Wed, 2004-11-24 at 01:25, Satish Plakote wrote:
> Hi
> I am have a web application that does a lot of processing. I have a load on 
> startup servlet that will get init information for me.
> when 2 users submit the form.. i noticed that one instance of the servlet is 
> running and the other request waits for some time for
> processor and just dies off.. Servlets are suppose to be thread safe and 'n' 
> number of intances can be created . why only one
> instance running  at a given time.. My servlet is not a single instance 
> servlet and i have not placed an restrictions of that sort..
> can anyone help me with this ??

First, if you're running a Servlet 2.3 or higher version of Tomcat (4x
and up, I think) you should move your initialization code to a context
listener.

Servlets are threadsafe but your code isn't necessarily.  Are both
instances making calls to methods in another object (maybe one that
locks a file or resource while working on it).  Are you using instance
variables in your servlet?



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to