A quick question without going over all that code:
The problem is, that when another user sends a message. ALL instances
of the
variables seem to swap over to the most recent.
static variables? these get instantiated once per class not per object
and thus would act as you have said
I've not declared any variables as static
-Original Message-
From: Ray Letts [mailto:[EMAIL PROTECTED]]
Sent: 21 May 2002 22:18
To: Tomcat Users List
Subject: Re: ***Please reply as no one on this list has offered ANY help***
A quick question without going over all that code:
The
alright. leaving aside the issue of your subject line...
I, too, am not reading all that code until I get a better idea of what
you're actually asking. For instance, do you know the following?
only ONE instance of a servlet is created in the servlet container. That
means that every request
Without digging in too deeply, is it possible your problem is the cloning of the
'meet' Hashtable in connectUser?
Remember that cloning a Hashtable (and other Collection/Dictionary objects) is a
shallow clone. Only the table itself is cloned, not the objects pointed to by
the table.
I'm not
Nah, I put meet.clone() as a test, I just didn't take it off again.
I've been told by someone on the list to try using the session to reference
things instead. I'll have to give that a go before I continue asking
questions.
Thank you for a response.
-Original Message-
From: Denis
Hi Stuart,
It looks as if you have a problem with instance variables (variables in a
class declared outside a method). All logins are going to be using the same
copy of the code, i.e. same variable space etc. All synchronizing does is
make sure that the threads play nice when modifying the