aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes doubt in Sessin Migration Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "doubt in Sessin Migration" Watch "doubt in Sessin Migration" New topic
Author

doubt in Sessin Migration

Poonam Agarwal
Ranch Hand

Joined: May 12, 2008
Posts: 323
hello ranchers,

I have doubts in session managements. In the distributed web apps, container might do the load-balancing by taking client request and sending them out to JVM's. In these kind of web apps
1. There is one ServletContext per VM.
2.There is one ServletConfig per servlet, per VM.
3. BUT there is only one HttpSession object for given session ID per web apps, regardless the no of VM's. that means only HttpSession objects and their attributes can migrates from one VM to another.

So my question is:-- If there is only one session id given to the session object at a time then how can container recognize a particular clients based on the session ID. becouse till a particular seesion objects invalidates, all the requests are associated with the same session id.
please help me out to understand this as i got stuck in this.

Thanks in advance


Thanks <br />Poonam Agarwal SCWCD 86%
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3838

how can container recognize a particular clients based on the session ID


For the container it's all about requests. Either by cookie information or jsessionid request header of the request, container identify the correct session object which should associate with that request.


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
Poonam Agarwal
Ranch Hand

Joined: May 12, 2008
Posts: 323
thanks Vijitha for your reply, But my question is how all the request are handled by the conatiner when there is only one Httpsession object with a unique session ID per web apps. when client A sends the request its sends with the particular session ID and when client B sends the request is it also sends with the same session ID??? if this so, then how container differentiate between client A and B?

please reply
Thanks
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3838

But my question is how all the request are handled by the conatiner when there is only one Httpsession object with a unique session ID per web apps


No. Each different client has different HttpSession object associated in the server with unique session ID. I think you have misunderstood the statement. When a another client accesses the web app from somewhere else he gets a different HttpSession object created for him with a unique session ID.

In your 3rd statement
BUT there is only one HttpSession object for given session ID per web apps


I think they mean, only one HttpSession object for each different client per web app regardless the app is distributed among more than one JVM.
Poonam Agarwal
Ranch Hand

Joined: May 12, 2008
Posts: 323
Thanks Vijitha to make me understand this.. i really appreciate your effort to clear my doubts.

Thanks again
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: doubt in Sessin Migration