Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@apache.org Received: (qmail 22426 invoked from network); 13 Nov 2001 21:59:49 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 13 Nov 2001 21:59:49 -0000 Received: (qmail 7122 invoked by uid 97); 13 Nov 2001 21:59:04 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-user@jakarta.apache.org Received: (qmail 7026 invoked by uid 97); 13 Nov 2001 21:59:03 -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 6970 invoked from network); 13 Nov 2001 21:59:02 -0000 Date: Tue, 13 Nov 2001 13:45:49 -0800 (PST) From: "Craig R. McClanahan" Sender: To: Tomcat Users List Subject: Re: UnknownHostException thrown from SmtpClient In-Reply-To: Message-ID: <20011113133515.A18567-100000@localhost> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Rating: localhost 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N On Tue, 13 Nov 2001, felix wrote: > Date: Tue, 13 Nov 2001 16:43:02 -0500 > From: felix > Reply-To: Tomcat Users List > To: Tomcat Users List > Subject: Re: UnknownHostException thrown from SmtpClient > > > Thanks, I think that's what needs to be done anyway. > > on a related topic, > I've been trying to figure out if JavaMail threads / forks when it sends. > The standard implementation of SMTP sending does not. You could certainly write one that does. (In one of my past lives, I wrote a JavaMail "Transport" implementation that interfaced to a fax broadcast service, and the calling application could be configured to use multiple threads -- it mattered when we were sending thousands of faxes for a for-pay subscription service.) > Or if its worth writing an Emailer (implements Runnable) that would just > take care of its business and let tomcat go on its merrry way. > > the user doesn't need to know what we are emailing or if it succeeds. > > anybody have any thoughts on that ? extra thread overhead ? waste of my > time ? > Besides the fact that it's probably an insignificant effect on response time (unless you're sending large numbers of messages on one request), using a separate thread here can be ***very*** dangerous if your thread that creates the response needs access to the original request. Once the service() method of your servlet returns, it is not legal to reference the request attributes -- so, if your message sending thread took longer than the rest of the service() method, you'd be out of luck. By the way, Tomcat 4 offers support for a JavaMail resource that you can access from all of the servlets and JSP pages in your web app, without having to configure all of them for the appropriate SMTP host. See http://jakarta.apache.org/tomcat/tomcat-4.0-doc/jndi-resources-howto.html and read the section on "JavaMail Sessions" for configuration information and a simple example. Craig -- To unsubscribe: For additional commands: Troubles with the list: