Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Q:17 JavaRanck mock exam

 
Srini Admala
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Servlets that implement the SingleThreadedModel cannot share a single HttpSession Object accross multiple servlets.
Correct Answer : False.
I chose "True" as my answer because
multiple requests can belong to the same session
and there could be multiple instances of the servlets implementing SingleThreadedModel.

Can any explain this please ?

-Srini
 
Marlon Bravo
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think that's a trick question. It's suppose to be SingleThreadModel, not SingleThreadedModel.
 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There ain't no trick in that. Its an error, a simple plain typo error. See my post here.
Now turning to the real qstn..........

Servlets that implement the SingleThreadedModel cannot share a single HttpSession Object accross multiple servlets.

Even though Servlets implement SingleThreadModel, they can still share a "session" among them. SingleThreadModel only gaurentees that there is ONLY ONE thread executing THIS PARTICULAR servlet.
Thats the end of responsibility of SingleThreadModel, it doesn't have any responsibility regarding Shared resources.
regds.
- satya
[ February 17, 2002: Message edited by: Madhav Lakkapragada ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic