Win a copy of Spark in Action this week in the Open Source Projects forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Session migration

 
Greenhorn
Posts: 9
IntelliJ IDE Windows XP Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have finished reading HFSJ second time and currently am preparing for the exam with the help of Enthuware JWeb Plus V5.

The question(QID com.enthuware.ets.scwcd.v5.2.328) is "Assuming that a web application is marked as distributed, which of the following statements are correct:" and one of the correct answers was "All request that belong to a session are handled by one JVM at a time."

Could somebody please explain this to me? I thought that session migration happens exactly when different requests come for one session to different JVMs.

How I understand it:
Say a user has made request1, which was sent to JVM1 and which created a session. Then the users make request 2 and it is sent to another JVM, say, JVM2. The container sees that the session associated with this request is on JVM1 and migrates the session object to JVM2. That is when SessionActivationListener gets informed.

Am I wrong?

If "All request that belong to a session are handled by one JVM at a time." then in what case does the migration happen?
 
Creator of Enthuware JWS+ V6
Posts: 3348
303
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Stanislav,

By reading your story I think that you understood it well.

But what the authors (enthuware) might have wanted to say is that there are not two requests handled by two JVMs at the same time. The Session object is not replicated but migrated. If the Session object was available in both JVMs at the same time it could handle each incoming request without having to migrate.

Hope this makes a bit more sense.

Regards,
Frits
 
And tomorrow is the circus! We can go to the circus! I love the circus! We can take this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic