tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shapira, Yoav" <Yoav.Shap...@mpi.com>
Subject RE: Problem with session counting
Date Mon, 30 Aug 2004 13:26:44 GMT

Hi,
Does it make a difference if you make the counter int not static and the two interface methods
that increment/decrement the counter synchronized?

Yoav Shapira
Millennium Research Informatics


>-----Original Message-----
>From: Michael S├╝dkamp [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 session
>listener code below.
>I test my app with Apache JMeter and run a test with 10 threads for about 3
>minutes.
>Then I stop the test and let the sessions time out (session timeout is 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 expected
>10 sessions (it rises to 13-16 sessions depending on the test duration).
>
>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 = 0;
>
>  public void sessionCreated(HttpSessionEvent event) {
>    sessionCount++;
>    System.out.println("sessionCreated: sessionCount="+sessionCount);
>  }
>
>  public void sessionDestroyed(HttpSessionEvent event) {
>    sessionCount--;
>    System.out.println("sessionDestroyed: sessionCount="+sessionCount);
>  }
>
>}
>
>
>
>---------------------------------------------------------------------
>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 communication, and may
contain information that is confidential, proprietary and/or privileged.  This e-mail is intended
only for the individual(s) to whom it is addressed, and may not be saved, copied, printed,
disclosed or used by anyone else.  If you are not the(an) intended recipient, 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


Mime
View raw message