| Author |
HttpSession concept
|
nippon ask
Greenhorn
Joined: Nov 03, 2003
Posts: 2
|
|
Hi, i'm getting weird things on my user sessions, so i was wondering... ...Is the HttpSession thread-safe? I'm having users objects 'setted' on other users sessions, so, may it be that i need to enclose the code in a 'synchronized' block? I'll appreciate any help... R
|
 |
William Brogden
Author and all-around good cowpoke
Rancher
Joined: Mar 22, 2000
Posts: 12271
|
|
Sessions are not automatically Thread-safe, but should be unique to individual users. Confusion of objects between users is almost certainly due to bad program architecture and will not be helped by synchronization. The only time you should have to worry about synchronizing access to objects in sessions is when you have the possibility of processing multiple requests from the same user "at the same time" - for example with frames or where images are being generated. Bill
|
Java Resources at www.wbrogden.com
|
 |
 |
|
|
subject: HttpSession concept
|
|
|