This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Servlets and the fly likes session management technique Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "session management technique" Watch "session management technique" New topic
Author

session management technique

ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
What's lacking in this session management technique?

Whenever we need to put something in session, we do:



And whenever we need to get from session:



Say 1000 users are hitting the site at the same time and same piece of code is getting executed for all 1000 users (requests) - they are doing the same thing. Now this code will be executed in 1000 threads - since request object is different for all 1000 threads, session object will also be different and there will not be any "clash" between users - and they will never access others' information.

Please let me know if my assumptions are not correct.

Thanks.
[ October 15, 2008: Message edited by: ankur rathi ]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60752
    
  65

It has nothing to do with the requests, but yes, each user will have their oun session.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: session management technique
 
Similar Threads
Synchronizer Token: for the J2EE pattern book authors ...
Chapter 6(Session Management) notes (HFSJ) for revision
threads and synchronization
simple question abt session management
multithreaded web application session issue