Thank you very much for your solution Charles. It worked. This proves the
fact that my statement, saying there is no dynamically changing variable at
class scope, in my first mail is wrong. I realised what went wrong.
Thanks once again to all who applied their precious time.
regards,

Bhaskar Varanasi
IIC Technologies Pvt. Ltd.,
Hyderabad.
http://www.iictechnologies.com

Alternate e-mail :
[EMAIL PROTECTED]
[EMAIL PROTECTED]


-----Original Message-----
From: A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of
Charles Chen
Sent: Friday, October 13, 2000 5:10 PM
To: [EMAIL PROTECTED]
Subject: Re: A question about the fundamentals! [Scanned by Yellow Pages
PostMaster]


Contact:   Tel: 2726  -  New Media Systems, 1st Floor South, Queens Walk




Even if this is not going to solve your problem, try to remove the line
"PrintWriter out = null" from class declaration and define an PrintWriter
object
inside the doGet and doPost methods.

The idea behind this is that the 'out' variable in your code is defined in
class
and therefore will be shared by all the threads of your servlet as long as
your
servlet is loaded once and reused, which seems to be the case as you want to
share and keep the database connection . When all the requests come in the
same
time, the real object the 'out' refers to will be unpredictable. Defining it
locally to the doPost method will ensure that no thread will use other
threads
'out' object.



Charles

___________________________________________________________________________
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

___________________________________________________________________________
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

Reply via email to