Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@www.apache.org Received: (qmail 88218 invoked from network); 30 Aug 2004 13:28:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 30 Aug 2004 13:28:13 -0000 Received: (qmail 71099 invoked by uid 500); 30 Aug 2004 13:27:39 -0000 Delivered-To: apmail-jakarta-tomcat-user-archive@jakarta.apache.org Received: (qmail 71072 invoked by uid 500); 30 Aug 2004 13:27:39 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 71059 invoked by uid 99); 30 Aug 2004 13:27:39 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from [63.244.250.133] (HELO warhawk.mpi.com) (63.244.250.133) by apache.org (qpsmtpd/0.27.1) with ESMTP; Mon, 30 Aug 2004 06:27:37 -0700 Received: from lightning.mpi.com (lightning [63.244.252.11]) by warhawk.mpi.com (Switch-3.1.6/Switch-3.1.6) with ESMTP id i7UDRYlI009271 for ; Mon, 30 Aug 2004 09:27:35 -0400 (EDT) Received: from US-VS1.corp.mpi.com (us-be2.corp.mpi.com [63.244.252.32]) by lightning.mpi.com (Switch-3.1.6/Switch-3.1.6) with ESMTP id i7UDR3md010777 for ; Mon, 30 Aug 2004 09:27:32 -0400 (EDT) X-MimeOLE: Produced By Microsoft Exchange V6.0.6487.1 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: Problem with session counting Date: Mon, 30 Aug 2004 09:26:44 -0400 Message-ID: <9C5166762F311146951505C6790A9CF80229BF9C@US-VS1.corp.mpi.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Problem with session counting Thread-Index: AcSOlLF7H+Kzs5XvSWCY4PU3z1C4ogAADz1g From: "Shapira, Yoav" To: "Tomcat Users List" X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N H= i, Does it make a difference if you make the counter int not static and t= he two interface methods that increment/decrement the counter synchron= ized? Yoav Shapira Millennium Research Informatics >-----Original Message----- >From: Michael S=FCdkamp [mailto:michael.suedkamp@docware.de] >Sent: Monday, August 30, 2004 9:24 AM >To: tomcat-user@jakarta.apache.org >Subject: Problem with session counting > >Hi, > >I have problems tracking the lifecycle of my sessions. I use the sess= ion >listener code below. >I test my app with Apache JMeter and run a test with 10 threads for a= bout 3 >minutes. >Then I stop the test and let the sessions time out (session timeout i= s set >to 5 min) > >Almost everytime the session counter is greater than 0 when I expect = it to >be 0. >My logs show that my session count during the test goes beyond the ex= pected >10 sessions (it rises to 13-16 sessions depending on the test duratio= n). > >The Tomcat manager reports 10 sessions during the test and 0 sessions= after >all sessions have timesd out. > >Is there anything wrong I can do with my sessions so that the created= and >destroyed sessions are not balanced? > >Thanks > >Michael > > >public class SimpleSessionListener implements HttpSessionListener { > > private static int sessionCount =3D 0; > > public void sessionCreated(HttpSessionEvent event) { > sessionCount++; > System.out.println("sessionCreated: sessionCount=3D"+sessionCount= ); > } > > public void sessionDestroyed(HttpSessionEvent event) { > sessionCount--; > System.out.println("sessionDestroyed: sessionCount=3D"+sessionCou= nt); > } > >} > > > >---------------------------------------------------------------------= >To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org >For additional commands, e-mail: tomcat-user-help@jakarta.apache.org This e-mail, including any attachments, is a confidential business com= munication, and may contain information that is confidential, propriet= ary and/or privileged. This e-mail is intended only for the individua= l(s) to whom it is addressed, and may not be saved, copied, printed, d= isclosed or used by anyone else. If you are not the(an) intended reci= pient, please immediately delete this e-mail from your computer system= and notify the sender. Thank you. --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-user-help@jakarta.apache.org