This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Session Migration issues Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Session Migration issues" Watch "Session Migration issues" New topic
Author

Session Migration issues

Chetan Sahasrabudhe
Ranch Hand

Joined: Aug 09, 2004
Posts: 75
As pe the book session will get migrated across JVM in load balanced environment.
I need more information regarding session behavior of below given scenario

1. Client (window 1) gets session from Container A
2. Client (Window 2) makes a second request that gets passed on to Container B.
3. Container B asks for session object from Container A
4. Same time client opens second window
5. Client (Window 1) request is with Container B
6. Client (Window 2) request goes to Container A

As per the book across containers there will be only one session object present.

How will container A and container B respond to the situation.


Thanks & Regards<br />Chetan
Narendra Dhande
Ranch Hand

Joined: Dec 04, 2004
Posts: 950
Originally posted by Chetan Sahasrabudhe:
As pe the book session will get migrated across JVM in load balanced environment.
I need more information regarding session behavior of below given scenario

1. Client (window 1) gets session from Container A
2. Client (Window 2) makes a second request that gets passed on to Container B.
3. Container B asks for session object from Container A
4. Same time client opens second window
5. Client (Window 1) request is with Container B
6. Client (Window 2) request goes to Container A

As per the book across containers there will be only one session object present.

How will container A and container B respond to the situation.


Hi,

First thing that there is only one container spread accross the JVMS in the cluster. The default application run only on one JVM. You Can not selectively send the request to particular JVM, it is the job of load balancer. The load balancer normally dispatch the request, where the session exist. If the load balancer decide to migrate the session to another JVM, it will take care to migrate and dispatch the request. In the commercial application servers, the administrator can move one session from one JVM to another. But the load balancer take care of dispatching request to the appropriate JVM. Most of the time session migration is transperant to client user.

hope it help.

Thanks


Narendra Dhande
SCJP 1.4,SCWCD 1.4, SCBCD 5.0, SCDJWS 5.0, SCEA 5.0
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

Originally posted by Chetan Sahasrabudhe:

1. Client (window 1) gets session from Container A
2. Client (Window 2) makes a second request that gets passed on to Container B.
3. Container B asks for session object from Container A
4. Same time client opens second window
5. Client (Window 1) request is with Container B
6. Client (Window 2) request goes to Container A


A few pointers here. You never said if windows 1 and 2 were sharing a session. They may or may not, depending on how the second window gets created. Also, do you mean in step 4 that a third window is opened? Again, you never said how that window was opened.

Typically, if the subsequent window is spawned from the first it will share the same session. This can happen by clicking a link from within the first window or using a browser shortcut (Ctrl+N in IE) to clone your first window.

However, if the second window is created by opening a new instance of your browser (usually by selecting the application or shortcut from your desktop) it will not share the same session with the first window.


A good workman is known by his tools.
Yogesh Hingmire
Ranch Hand

Joined: Dec 06, 2005
Posts: 61
Narendra ,

Can you guide us to link on clustering and load balancing..

Would be of immense help!!!

Thanks,
Yogesh
Narendra Dhande
Ranch Hand

Joined: Dec 04, 2004
Posts: 950
Ho Yogesh,

Load balancing and Clustering is a very vast topic. In the above post I am talking about the clustering and load balancing at application server level. In the same line you can refer following URLs which give you idea. For the details you have to look up in particular application server documentation.

Reference 1 .

Reference 2

Hope this help

Thanks
 
jQuery in Action, 2nd edition
 
subject: Session Migration issues
 
Similar Threads
Chapter 6(Session Management) notes (HFSJ) for revision
Sessions from multiple apps on single server...
Session management ambiguity
MVC Architecture.
MVC Architecture