struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Hardy <>
Subject Re: Quick question about iterators & beans on a page
Date Sat, 16 Feb 2002 18:29:41 GMT
On Sat, 16 February 2002, Mark Woon wrote:
> > (2) is it thread-safe? Guess it must be, but why? Does it all stay in one thread
of the main struts controller servlet, and out of reach of any other threads?
> Depends on what you mean.  If it's a read-only collection, then sure, it's "thread safe".
 But if you expect that list to change, then no, it's not thread-safe, because multiple
> requests from the same user would be able to access the collection.
> -Mark

Argh! The list is user dependent - it's got to be thread-safe. 

So if the Action puts the array for the iterator in the request, how can I make sure that
no other user gets it?

I know what you're going to say - put it in the session, right? But then at the end of the
day a user who uses the site intensively all day might end up with a rowset or even two in
their session for every page in the site.

So what do I do? 


Find the best deals on the web at AltaVista Shopping!

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message