> use a static ThreadLocal (singleton) to hold the > connection and thus associate a Connection with the thread - the same thread > will be used to call the service handler at which point it can call > MyThreadSpecificConnectionHolder.get() to get the connection assigned to the > thread back out >
Thanks for your suggestion. My servlet is like the following: ----------------------------------------------------------------------------------------------------------- public class CtuAxisServlet extends AxisServlet { private static Application _app = null; public CtuAxisServlet() { super(); } public void init() throws javax.servlet.ServletException { super.init(); ServletContext sContext = this.getServletContext(); _app = (Application) sContext.getAttribute("Application"); } private static ThreadLocal tm_app = new ThreadLocal() { protected synchronized Object getTMApp() { return _app ; } }; } ----------------------------------------------------------------------------------------------------------- A method name getConnection is encapsulated in _app object which is used to get a data connection from my connection pool. Right now , I still don't know how to get this _app object in my service class(A java class which is deployed onto axis as my web service). Could you please explain more to me ? Thanks ! Ken -- 研發部 胡重威 Ken Hu [EMAIL PROTECTED] 孟華科技股份有限公司 http://www.mmti.com.tw 高雄巿804鼓山區蓮海路70號 國立中山大學創新育成中心511室 電話 07-5253020 傳真 07-5252165 行動 0937083880