Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Is HttpSessionAttributeListener Single Threaded

 
Alec Lee
Ranch Hand
Posts: 569
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is HttpSessionAttributeListener executed in single thread? Does a call to servletContext.setAttribute() inside it require synchronization?
 
Narendra Dhande
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Is HttpSessionAttributeListener executed in single thread? Does a call to servletContext.setAttribute() inside it require synchronization?


I don't think the HttpSessionAttributeListener executed in single thread. Can you any specify specific example about your conclusion.

Attributes to Servlet Context are not related to session objects. If this question is related to distributed application, the servlet container have no gurantee to migrate the Context attributes so no question of sync.


Thanks
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!