As the threads use the same address-space, if you use instance or class
variables in your class (apart from connections), it can happen that the
concurrent threads can overwrite s values set by a paralell thread. That
fact can cause the same symptoms.
A practicable solution to avoid this problem that you should use only local
variables (since local vars are stored in the stack, which is unique for
each thread) and these vars should be passed to the needed methods (in which
these variables are wanted) as parameters.
A bit more complicated way is to use a centralized data-structure similar to
ConnectionPool in order to store vars you want to share between methods. Of
course, this data-structure must be handled thru synchronized methods.
Zsolt Horvath.
----Original message----
From: Kumaravadivelu <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Sent: Wednesday, December 1, 1999 6:43 AM
Subject: Response while multiple hits
>Hi,
>I have a problem in getting response from the servlet when I call the
>servlet simultaneously from different browsers/browser windows. The problem
>is if I call the servlet from two browsers, one shows the response page
>where as the second one show me an error 'document contains no data', can
>anyone please let me know why am getting this error?
>
>...
___________________________________________________________________________
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