Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript 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

HttpSession question.

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, everyone,

I met this question and I am not sure the answer. Can anyone give me the answer and explain it?


Which of the following statements are NOT true about the behavior of an HttpSession object in a distributable environment?
(Choose 2 answers)

A.) HttpSessionEvents are always propagated from one JVM to another
B. )An HttpSession can reside only on one JVM at a time.
C. )When a session migrates, all the session attributes that implement the HttpSessionActivationListener are notified
D. )When a session migrates, the readObject() and writeObject() methods of all its attributes are surely invoked.

BTW, where can I get more information about distributable envirooment?

Thank you very much.

Anna
 
Ranch Hand
Posts: 380
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think answer is A and D (only attributes implementing serializable interface need to be migrated)
 
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
no both a and d are wrong.
from spec pg no:61

Developers are not guaranteed that containers will call readObject and writeObject methods on session attributes if they implement them, but are guaranteed that the Serializable closure of their attributes will be preserved.


B is right. a session can reside at a time in only one jvm.
of course c is right.thats why we have session activation listener event.

BTW, where can I get more information about distributable envirooment?


nowhere than the spec.(SRV.7.7.2)
[ September 01, 2006: Message edited by: cheenu Dev ]
 
Shivani Chandna
Ranch Hand
Posts: 380
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The question is asking about "NOT true behaviour" ....
 
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


This thread has an important lesson for all the aspirants ....

"Read the questions carefully , otherwise you can screw a perfectly answerable question"
 
cheenu Dev
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
made a mistake.
 
Yup, yup, yup. Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic