Ok. I have some questions: The local variables and method aruments are thread safe? How I can use and how work the SingleThreadModel? Is a god idea use the service method in a Servlet derivated from HttpServlet? ThX for your help. JcSO
1. yes, local variables are thread safe 2. you just declare that the servlet implements SingleThreadModel - the servlet engine does the rest automatically. 3. why would you want to? Inheriting from HttpServlet is done so you can use doPost, etc. People doing special processing of non-HTTP requests override service. Bill
Joined: Mar 26, 2002
ThX for your help William, i have another question: In my actual application i have a socket connection and DB connection, but i open and close theses connections each time that i call my servlet, now i want use a pool for theses connections, which framework is recomended??? confused: JcSO :
Author and all-around good cowpoke
Joined: Mar 22, 2000
I did a search at java.sun.com for "connection pool" and found a bunch of references. I don't have any particular recommendation. Bill
you can reuse at least database connection if you initialize them in the init() method of the servlet and destroy them in the destroy() method. In another thread they said that apache.jarkarta.struts has a connction pool implemented. Why not use struts or trying to understand their connection pool implementation?