Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@www.apache.org Received: (qmail 38528 invoked from network); 9 Feb 2004 18:47:01 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 9 Feb 2004 18:47:01 -0000 Received: (qmail 26849 invoked by uid 500); 9 Feb 2004 18:46:13 -0000 Delivered-To: apmail-jakarta-tomcat-user-archive@jakarta.apache.org Received: (qmail 26818 invoked by uid 500); 9 Feb 2004 18:46:12 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 26531 invoked from network); 9 Feb 2004 18:46:06 -0000 Received: from unknown (HELO mail.africaonline.co.zw) (216.104.196.107) by daedalus.apache.org with SMTP; 9 Feb 2004 18:46:06 -0000 Received: from [216.104.194.229] (helo=designat7.co.zw) by mail.africaonline.co.zw with esmtp (Exim 3.35 #2) id 1AqGMS-0004oC-00 for tomcat-user@jakarta.apache.org; Mon, 09 Feb 2004 20:42:24 +0200 Received: from designat7.co.zw ([10.0.0.1]) by designat7.co.zw (8.11.6/8.11.6) with ESMTP id i19IiMr25773 for ; Mon, 9 Feb 2004 20:44:22 +0200 Message-ID: <4027D688.3020707@designat7.co.zw> Date: Mon, 09 Feb 2004 20:50:48 +0200 From: kwirirai User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-GB; rv:1.0.1) Gecko/20020823 Netscape/7.0 (ax) X-Accept-Language: en-gb, en MIME-Version: 1.0 To: Tomcat Users List Subject: Re: Servlet thread safety in Tomcat References: <004201c3ef3a$58c54210$6f00000a@BALTHAZAR> Content-Type: multipart/alternative; boundary="------------060909030608010805090901" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N --------------060909030608010805090901 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Thanks ,It realy means I have to redesign the whole app ....,but there is the issue of networking and Java Mail, it seems the other servlet has to wait for a very long time for the other servlet to get all the mail.My question is can Tomcat process two sessions of a servlet downloading mail at the same time sopposing the other session is slow.Will the one with a faster connection finish first or will have to wait for the one with slow connection...? Mike Curwen wrote: >The one thing that could be said (so far), is to ensure you are using >properly scoped variables. Generally speaking, for servlets, that means >don't use something like the following: > >public class myservlet extends HttpServlet { > > private String MyBadlyPlacedVariable = null; > > public void doGet() { // exceptions and parameters snipped for >brevity > > MyBadlyPlacedVariable = >request.getParameter("some_variable_used_later"); > > // later on in the code, use "MyBadlyPlacedVariable"... > // it probably contains a value you're not expecting! > } >} > > >You'll for sure experince threading problems, and this is the most >likely cause of any class of problems that's generically described as: >"the data is actualy mixing up". > > > >> >> >>>-----Original Message----- >>>From: kwirirai [mailto:kwirirai@designat7.co.zw] >>>Sent: Monday, February 09, 2004 12:48 PM >>>To: tomcat-user@jakarta.apache.org >>>Subject: Servlet thread safety in Tomcat >>> >>>Hi All >>>I am developing an application that uses JavaMail.What I am >>> >>> >>concered is >> >> >>>the issue of thread safety,and efficiency.My question is do >>> >>> >>I need to >> >> >>>employ synchronized blocks in my Servlet code or is there another way >>> >>> >>to >> >> >>>implement thread safety.I have been experimenting with the >>> >>> >>application >> >> >>>and I have seen that the data is actualy mixing up.I realy >>> >>> >>need to now >> >> >>>how Tomcat handles request and issues those request ,this is in >>>connection with threading. I have thought about the single >>> >>> >>thread model >> >> >>> in my servlets but I think this is an inefficient method to use. >>> >>>Thanks >>>Kwiri >>> >>> >>> >>> >>>--------------------------------------------------------------------- >>>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org >>>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org >>> >>> >> >> >>This e-mail, including any attachments, is a confidential >>business communication, and may contain information that is >>confidential, proprietary and/or privileged. This e-mail is >>intended only for the individual(s) to whom it is addressed, >>and may not be saved, copied, printed, disclosed or used by >>anyone else. If you are not the(an) intended recipient, >>please immediately delete this e-mail from your computer >>system and notify the sender. Thank you. >> >> >>--------------------------------------------------------------------- >>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org >>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org >> >> >> > > >--------------------------------------------------------------------- >To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org >For additional commands, e-mail: tomcat-user-help@jakarta.apache.org > > > > --------------060909030608010805090901--