I know this issue has been discussed before, but I have a new question. Lets say we have a
servlet that defines a single, non-static instance variable that is an object, not a primitive type. Lets also say that this servlet has a method called "test()", which does nothing other than invoking a method on the servlets instance variable.
Now, if two
thread access the servlet and call
test() concurrently, what happens when the test() method invokes a method on the instance variable? Would each thread get its own copy of the method invoked on the instance variable?
I'm asking because I have a servlet that loads a class dynamically and creates a single instance of the class then stores a reference to the instance into an instance varaible of the servlet, so I'm concerned about having only one instance of this class that multiple clients can access.
thanks,
SAF
[ January 11, 2002: Message edited by: SAFROLE YUTANI ]