Here's a couple of ideas I have.  Why not rewrite the JavaMail app to use
threads or allow multiprocessing.  If not you could make an intermediary
class that takes the information from the users and holds it in a queue.
This way the middle class can wait and send the info to the JavaMail app as
available and the users can continue on to other things.

        ~Matt

 -----Original Message-----
From:   A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:[EMAIL PROTECTED]]  On Behalf Of
fumitada
Sent:   Saturday, December 09, 2000 2:39 PM
To:     [EMAIL PROTECTED]
Subject:        Servlet + JavaMail

Hi everybody.

I'm making a servlet which calls my JavaMail application (not bean).
The Javamail app retrieves email addresses from database and send emails.

The servlet is of course multi-thread, but the JavaMail app.
so If the servlet is called by 2 viewers at the same time, as you guess,
the JavaMail app throws Error like "Transport cannot connect...or SMTP
blah blah..." because 2 instances of the JavaMail app try to connect
SMTP at the same time.

How can I avoid this problem ?

I was gonna use synchronized methods in the JavaMail app, but I was
kinda afraid that the first person who calls the servlet is okay, but
the second person have to wait until all works of the first person is
done. I guess the second person have to look at the display for long
time and even doesn't know the page is stucked or still working.

Are there any good ways to avoid it ?

Thanks in advance !

Fumitada Hattori.

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to