• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Which attribute scopes are thread-safe ?

 
morph wang
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Objective 7.1: Identify which attribute scopes are thread-safe:
Local variables
Instance variables
Class variables
Request attributes
Session attributes
Context attributes

I supposed the answer is:
Local variables
Instance variables
Request attributes
According to me understanding, the 'Session attributes' is the implicit 'session' object, and the 'Context attributes' is the implicit 'application' object. They are not thread-safe.
Please correct me if I'm wrong .
[This message has been edited by morph wang (edited November 19, 2001).]
 
Gagan Indus
Ranch Hand
Posts: 346
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Instance variables" are thread-safe only if your servlets implements SingleThreadModel , or your JSP page-diective has isThreadSafe="false"
------------------
Gagan (/^_^\) SCJP2
Die-hard JavaMonk -- little Java a day , keeps u going .
 
morph wang
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Gagan Indus:
"Instance variables" are thread-safe only if your servlets implements [b]SingleThreadModel , or your JSP page-diective has isThreadSafe="false"
[/B]

Thanks much. I agree with
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic