aspose file tools
The moose likes Servlets and the fly likes SingleThreadModel Interface Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "SingleThreadModel Interface" Watch "SingleThreadModel Interface" New topic
Author

SingleThreadModel Interface

Pandurangan Rakesh
Greenhorn

Joined: Jun 06, 2004
Posts: 24
Hi

I know that servlet is multithreaded by default.By using singlethreadmodel interface does its multithreading capabilities are restricted?to what extent?
also can anyone tell me when we use singlethread model interface?i heard that this is to be deprecated soon?

Thanks
Rakesh
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12325
    
    1
If your servlet implements SingleThreadModel, the servlet engine will ensure that a given instance only handles one request at a time.
In my opinion, SingleThreadModel was created early in the development of the servlet API as a crutch for people having a hard time making the transistion from desktop single user applications to servlets. I know of no valid excuse for using it these days.

Bill


Java Resources at www.wbrogden.com
Peter den Haan
author
Ranch Hand

Joined: Apr 20, 2000
Posts: 3252
It has been deprecated in the Servlet 2.4 spec (part of J2EE 1.4) without replacement. Which begs the question: if it was a superfluous, bad idea for servlets, what makes it a good idea for stateless EJBs?

- Peter
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: SingleThreadModel Interface
 
Similar Threads
a question for all who already taken scwcd 1.4 exam..
threading issues in JSP and Servlets
difference between Java Servlet Specification 2.3 and the earlier versions
Are JSPs Thread Safe ?
singlethreadmodel