-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Caldarale, Charles R wrote: >>From: James Black [mailto:[EMAIL PROTECTED] >>Subject: re: making a singleton servlet >> >>I am going to make my servlet be static, with the hope that >>it will only have one instance running, regardless of how >>many clients connect to it. > > > What do you mean by "servlet be static"? What syntactical construct are > you employing? > > If you mean using static fields in your servlet class, then you will > have to make use of synchronization clauses to insure concurrent > requests are serialized. It's my understanding that the container > (Tomcat or whatever) is free to process as many requests in parallel as > needed, as well as create multiple servlet instances - see the servlet > spec. > > What problem are you trying to solve?
My plan is to try: public static class SomeServlet extends HttpServlet { ... } That way there should only be one servlet. I am writing a servlet to save grades to a database, but, unfortunately, instructors will procrastinate like students do. So, I expect that 2000+ instructors will submit their grades in the last hour or so, before the deadline. If each instructor had their own db connection then the system will be useless, as students won't be able to get connections, since all the connections will be used up. For the first test I want to limit them to only one connection that will read from an input queue, and just process all the grades. Later it may be bumped up to 20-50 connections, to speed it up. That is the basic problem I am trying to solve. I am actually using XmlHttpRequest to connect to the servlet so it doesn't lock up the browser. - -- Corruptisima republica plurimae leges. [The more corrupt a republic, the more laws.] Tacitus from Annals III, 116AD -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (MingW32) iD8DBQFDlkneJ/zyYkX46joRAlfpAJ0cdiTxXrSSdLfZ3znd63dSJesvJACgiFes PfU+fddjZNUPTT1gq0Ft69g= =tKjO -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]