Steve Geach wrote:
>
> Can I assume that if all my variables and code are in the doGet method
> that I will be thread safe?
>
> I will have different users going through my servlet to access data
> relevant to them via JDBC/DB2 and I have to guarantee that no users will
> 'cross' threads and see each others data.
Maybe. It sounds like you probably are. There are two main areas of concern.
First, you need to protect access to instance variables; since you claim all
your variables are local to the doGet method you should be okay there. The other
area of concern is global resources such as files, connections, etc. The idea
here is that you may have a local variable that refers to a File object, but if
the File object is the same for all threads, you need to protect access to the
File if one thread could be writing while another is reading. It's hard to see
if you're okay in that area.
See the threading question in the FAQ (http://www.purpletech.com/servlet-faq/)
Kevin Mukhar
___________________________________________________________________________
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