Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How to make servlet thread safe?

Answer Posted / bhaskar padala

The servlet programmer should implement SingleThreadModel interface to ensure that servlet can handle only one request at a time. It is a marker interface, means have no methods.


This interface is currently deprecated since Servlet API 2.4 because it doesn't solves all the thread-safety issues such as static variable and session attributes can be accessed by multiple threads at the same time even if we have implemented the SingleThreadModel interface. So it is recommended to use other means to resolve these thread safety issues such as synchronized block etc.

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain their methods? Tell me their parameter names also have you used threads in servlet?

1035


Explain the steps involved in placing a servlet within a package?

1052


Define context initialization parameters.

1031


Elucidate servlet attributes and its scope?

1006


What is servlet and its advantages?

1046


What are the steps that are required to handle the multi-threading?

1100


Write a program to show the functionality of doget and dopost method?

1214


What are the drawbacks of cgi?

1033


How the servlet is loaded?

1073


Explain the difference between servlet and cgi?

1160


Why the concept of single thread model interface is used?

990


When is the servlet instance created in the life cycle of servlet? What is the importance of configuring a servlet?

1055


What are the different methods of session management in servlets?

1006


What are important features of Servlet 3?

1086


How can we refresh automatically when new data has entered the database?

1109