Return-Path: Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 17785 invoked from network); 24 May 2000 12:24:05 -0000 Received: from melone.austria.eu.net (193.154.142.240) by locus.apache.org with SMTP; 24 May 2000 12:24:05 -0000 Received: from austria.eu.net (xtoph.intern.Austria.EU.net [192.168.191.230]) by melone.Austria.EU.net (8.9.3/8.9.3) with ESMTP id OAA10803 for ; Wed, 24 May 2000 14:23:37 +0200 (MET DST) Sender: cma@Austria.EU.net Message-ID: <392BC93D.28F9E2F3@austria.eu.net> Date: Wed, 24 May 2000 14:21:17 +0200 From: Christoph Mack Organization: KPNQwest X-Mailer: Mozilla 4.7 [en] (X11; I; Linux 2.2.13 i686) X-Accept-Language: en MIME-Version: 1.0 To: "tomcat-user@jakarta.apache.org" Subject: When does a servlet instance die? Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N Hi! I understand that if I write a servlet that implements the SingleThreadModel concurrent accesses will be served by different servlet instances each with its own set of instance variables (eg. connections to a database). Assuming that there are many many concurrent requests occuring this means that there are also many many servlet instances running. If each instance opens a database connection in its init() procedure there will be a lot of connections open. My question is: What is tomcat's policy when it comes to destroy unused instances (and thereby close the open database connections)? Is an unused instance removed immediately? What happens if it is the last instance of the pool? Is there a timeout value as for sessions? I have to admit that I did not read the Java Servlet Specification word by word but on a quick look I could not find anything answering this question. If I am wrong please tell me the sections to read... thanks in advance Christoph Mack