• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

request and response(Thread safe--?)

 
bill bux
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is implementation of the request and response objects guaranteed to be thread safe?
thanks bill.
 
Amer Khan
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Bill,
It is my understanding, that implementation of request and response objects are not guaranteed to be thread safe,they should only be used within the scope of the request handling thread.References to the req and res objs must not be given to objects executing in other threads as the resulting behavior may be non deterministic.
cheers
Amer
[ May 05, 2003: Message edited by: Amer Khan ]
 
Sowmya Sridhar
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
The request and response objects are created and delivered by the container for each request. They are guarenteed to be thread safe within the service method (and its dispatched methods). Since it is possible that the container pools and re-uses the request/response objects, accessing them outside the scope of the service method can give unpredictable results. This is what the spec says.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic