You only have to have to worry about synchronization if those session
objects have instance variables. Of course objects that are put in the
session typically have instance variables, otherwise, what's the point of
putting them in the session? I guess you have to deal with the fact that the
session object could be accessed from multiple threads (requests) at the
same time so all the normal synchronization issues apply. Just look at the
instance variables of the object and think about whether there would be a
problem if methods that accessed those variables were called at the same
time. If there would be a problem then synchronize the methods or blocks of
code that manipulate/use the instance variables. 

Hal

-----Original Message-----
From: John Hunt
To: [EMAIL PROTECTED]
Sent: 2/4/01 4:21 AM
Subject: Re: member variables

What about anything that is put in the session
object??? When should I worry about synchronization
about such objects?
Suppose I put an object which has some some methods in
it? When should I worry about synchronization in the
code that lies in it?
Suppose I put an object in session and open two
browsers, are there synchronization issues then?
I think this is more of servlet question, but I think
I could get a better answer here.
Thanks
Hunt
--- "Craig R. McClanahan"
<[EMAIL PROTECTED]> wrote:
> Ted Husted wrote:
> 
> > There is a single action object per session.
> 
> Um, actually it is per *application*, not per
> *session*.  All users who call
> the same action URI are sharing the same action
> instance.
> 
> The primary implication of this is that instance
> variables in your action
> classes are shared across all requests, while local
> variables (inside the
> perform() method) is not shared.
> 
> Craig McClanahan
> 
> 


__________________________________________________
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

Reply via email to