If you are referring to Servlet Pooling, that would have solved our problem I believe, but we did not investigate it too much. We are using Tomcat 3.2.1 and one of our developers decided to investigate the source of the BufferInputStream class instead. Finding everything to be synchronized gave him the idea to write his own class removing synchronization, and allowing the server to handle the bandwidth and threading, instead of relying on the single instance of the servlet.
Brian "Haseltine, Celeste" wrote: > > Joe, > > Isn't the default behavior for servlets determined by the webserver you are > using? Some servers do have a single servlet instance per all users, but I > know the previous version of JRUN server (3.01) instantiated a new copy of > the servlet for every new/unique session id. I don't know about the new > version of JRUN server (3.1). I did look at the Sun page you reference > below, but it did not reference the page where the Sun standard for servlet > behavior is spelled out. > > Celete > > -----Original Message----- > From: Joe Cheng [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, January 15, 2002 3:39 PM > To: [EMAIL PROTECTED] > Subject: Re: Downloading files with jsp/servlets... > > Zvika, > > The default behavior for servlets is to have a *single* servlet instance > serve all incoming requests for that servlet, simultaneously. In other > words, it's not that each incoming request instantiates your servlet; on the > contrary, the servlet only gets instantiated once in the lifetime of your > webserver (well, more or less). > > That's why it's a bad idea to declare member data fields for servlets; you > may as well be declaring static fields, because that's effectively what > you're doing. Same thing with declaring variables in <%! %> blocks in JSP. > > The exception is if you implement SingleThreadModel, which guarantees that a > single instance of a servlet will not be serving two requests > simultaneously; the spec doesn't make it clear whether that happens via > synchronization, or whether multiple instance get created. > > http://java.sun.com/docs/books/tutorial/servlets/client-interaction/threads. > html > > Hope that helps clear it up a little. > > -jmc > > =========================================================================== > To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff > JSP-INTEREST". > For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST > DIGEST". > Some relevant FAQs on JSP/Servlets can be found at: > > http://archives.java.sun.com/jsp-interest.html > http://java.sun.com/products/jsp/faq.html > http://www.esperanto.org.nz/jsp/jspfaq.jsp > http://www.jguru.com/faq/index.jsp > http://www.jspinsider.com > > =========================================================================== > To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". > For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST". > Some relevant FAQs on JSP/Servlets can be found at: > > http://archives.java.sun.com/jsp-interest.html > http://java.sun.com/products/jsp/faq.html > http://www.esperanto.org.nz/jsp/jspfaq.jsp > http://www.jguru.com/faq/index.jsp > http://www.jspinsider.com =========================================================================== To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST". Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com
