Xiao F Chen/IS/UNL/UNEBR is out of the office.

2004-07-13 Thread Xiao F Chen




I will be out of the office starting  07/13/2004 and will not return until
08/11/2004.

I will respond to your message when I return.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



What's the right way to handle a long process without occupying a tomcat processor/thread?

2004-06-16 Thread Xiao F Chen


   Hello all, I have a scenario related to long process in handling a   
   servlet request. I am using tomcat 4.1 with apache 1.3.9. In one of our  
   applications, when a user logs in, we will determine if the account's
   email address has been verified or not. If not, the application will 
   ask the user submit an email address for verification using JavaMail.
   The process to verify the address is to send an email message to the 
   email address immediately. Most of times, the process is quick and we
   can get the real time info about whether or not the user account on the  
   mail server is valid or not. But sometimes when the user's email server  
   is down or slow, the process could take pretty long time to finish. In   
   the later case, Tomcat's max processors could be used up and 'no 
   processor available' error is thrown.

   I guess I can increase the maxProcessor number in server.xml (currently  
   it is set to 75), but it seems not the ideal way. I am wondering 
   whether or not I can spawn a new thread in the servlet and hand the  
   email verification to the new thread for processing, then the main   
   thread will return and be available for new request to reduce the 'no
   processor error'? One problem I can see is that even I can do what I 
   stated above, some document suggest that after the main thread returns   
   (for example, exit from the doGet method of a servlet), the  
   HttpServletResponse's outputstream is closed and I can't send response   
   to the user anymore. Is this right?  

   Any suggestions for my situation.

   Thanks for your help.










-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]