• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error in SCWCD Study Notes FAQs

 
Celinio Fernandes
Ranch Hand
Posts: 549
Eclipse IDE Google Web Toolkit Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://www.javacamp.org/scwcd/course/7_1.html

It says :
# Request attributes
Not thread-safe


It is wrong, request attributes ARE thread-safe.
 
Scott Johnson
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Read the quote farther down on that same page:


Thread-safe issue for Request & Response
Implementations of the request and response objects are not guaranteed to be thread safe. This means that they should only be used within the scope of the request handling thread. References to the request and response objects must not be given to objects executing in other threads as the resulting behavior may be nondeterministic.
-- SRV. 2.3.3.3.


So according to the servlet spec, the request object and it's attributes can be considered to be thread-safe so long as references to them are not passed to other threads. But there is no mechanism for stopping anyone from doing this. In the strictest sense, the request object and it's attributes are not guaranteed to be thread-safe.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic