File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes In what situation it will be helpful to use Servlet with SingleThreadModel. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "In what situation it will be helpful to use Servlet with SingleThreadModel." Watch "In what situation it will be helpful to use Servlet with SingleThreadModel." New topic
Author

In what situation it will be helpful to use Servlet with SingleThreadModel.

Deepti Lalwani
Greenhorn

Joined: Sep 20, 2011
Posts: 1

Can anyone help me understanding SingleThreadModel , I know it ensures that servlet handle only one request at a time and guarantees that no two threads will execute concurrently in the servlet's service method, but what will be the situation where we should use SingleThreadModel, I mean we can use plain java class using webservice.

In what situation it will be helpful and beneficial to use servlet with SingleThreadModel.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12269
    
    1
Short answer - NEVER


The original Servlet API included SingleThreadModel because web servers were a relatively new technology for Java developers and the designers thought that having STM might help people get started. As people have come to understand the web server environment they have realized that STM is not necessary and just causes complications.

Similar thinking brought us the "Invoker" servlet which has caused so much trouble.

We live and learn.

Bill

Java Resources at www.wbrogden.com
 
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: In what situation it will be helpful to use Servlet with SingleThreadModel.
 
Similar Threads
Difference between "SingleThreadModel" and "synchronised"?
performance using SingleThreadModel
servlet pool
servlets
SingleThreadModel Interface