A servlet that implements SingleThreadModel means that for every request, a single servlet instance is created. This is not a very scalable solution as most web servers handle multitudes of requests. A multi-threaded servlet means that one servlet is capable of handling many requests, which is the way most servlets should be implemented.
A single thread model for servlets is generally used to protect
sensitive data ( bank account operations ).
b. Single thread model means instance of the servlet gets created for each request recieved. Its not thread safe whereas in multi threaded only single instance of the servlet exists for what ever # of requests recieved. Its thread safe and is taken care by the servlet container.
SOURCE : www.referjava.com
No comments:
Post a Comment