• Post Reply Bookmark Topic Watch Topic
  • New Topic

Using SingleModel Interface vs Normal , Static vs SerlvetContext

 
Sanjay Ra
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

I am using the normal Serlvet life cycle with a serlvet that has some static initialization data
(During init).
Should i be using the serlvet Context for this with the singleModel interface instead?

thanks
Sanjay
 
Narendra Dhande
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

The SingleThread Interface is deprecated as per Servlet 2.4 specification. Though you use the SingleThread model, proper sync. is required. If the Servlet is running in distributed environment there may be ServletContext Instance per JVM. So it is always safe to sync. properly using any stratrgies.

Thank you.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!