Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SingleThreadModel interface - deprecated

 
Vishwa Kumba
Ranch Hand
Posts: 1066
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
SingleThreadModel interface has been deprecated in J2EE 1.4.

The reason as I understand from the docs is:

Note that SingleThreadModel does not solve all thread safety issues. For example, session attributes and static variables can still be accessed by multiple requests on multiple threads at the same time, even when SingleThreadModel servlets are used. It is recommended that a developer take other means to resolve those issues instead of implementing this interface, such as avoiding the usage of an instance variable or synchronizing the block of the code accessing those resources. This interface is deprecated in Servlet API version 2.4.


I wonder why this realisation only in Servlet 2.4? I always thought this was a problem even in the previous versions.

Finally Sun is not recommending the use of SingleThreadModel.
 
Arto Pastinen
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
heh.. quite funny.

Maby next Sun will recommend not to use clustering, beacause there is no support to lock session between nodes..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic