• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

Q:17 JavaRanck mock exam

 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think that's a trick question. It's suppose to be SingleThreadModel, not SingleThreadedModel.
 
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
pie. 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
reply
    Bookmark Topic Watch Topic
  • New Topic