• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Mock Exam Question on Session

 
Joe Harry
Ranch Hand
Posts: 10124
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is from the Javaranch Mock exam!

Servlets that implement the SingleThreadModel cannot share a single HttpSession Object accross multiple servlets. True or False?

I answered True. Am I right?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why ? The session is the same, whether SingleThreadModel is used or not. (note that SingleThreadModel is deprecated, and may not be at the exam)
 
Joe Harry
Ranch Hand
Posts: 10124
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then why is that question on the Javaranch Mock exam?
 
Sagar kanchi
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If there is single Http Session object then nothing will stop it being shared by multiple servlets. So, I think the answer is False.

Just to remind, Single Thread Model guarantees only single thread of execution at any given time and NOTHING ELSE.
 
Remko Strating
Ranch Hand
Posts: 893
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree the answer should be false
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then why is that question on the Javaranch Mock exam?

As written in the Links, this mock is for SCWCD 1.3.
 
Atul Sawant
Ranch Hand
Posts: 304
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hmmm...i think it is false too.

Initially, i thought it was true however i realized once a session is created by any servlet it does not belong to that servlet and can be accessed by other serlvets unless we have a block which has been schronized with session object.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic