Return-Path: Delivered-To: apmail-jakarta-tomcat-dev-archive@www.apache.org Received: (qmail 24339 invoked from network); 10 Dec 2003 21:09:52 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 10 Dec 2003 21:09:52 -0000 Received: (qmail 53770 invoked by uid 500); 10 Dec 2003 21:09:33 -0000 Delivered-To: apmail-jakarta-tomcat-dev-archive@jakarta.apache.org Received: (qmail 53727 invoked by uid 500); 10 Dec 2003 21:09:33 -0000 Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Developers List" Reply-To: "Tomcat Developers List" Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 53714 invoked from network); 10 Dec 2003 21:09:33 -0000 Received: from unknown (HELO nwkea-mail-1.sun.com) (192.18.42.13) by daedalus.apache.org with SMTP; 10 Dec 2003 21:09:33 -0000 Received: from phys-d3-ha21sca-1 ([129.145.155.163]) by nwkea-mail-1.sun.com (8.12.10/8.12.9) with ESMTP id hBAL9cUP003116 for ; Wed, 10 Dec 2003 13:09:38 -0800 (PST) Received: from AMYROH (vpn-129-150-16-91.SFBay.Sun.COM [129.150.16.91]) by ha21sca-mail1.sfbay.sun.com (iPlanet Messaging Server 5.2 HotFix 1.16 (built May 14 2003)) with ESMTP id <0HPP00FWW6S2DS@ha21sca-mail1.sfbay.sun.com> for tomcat-dev@jakarta.apache.org; Wed, 10 Dec 2003 13:09:38 -0800 (PST) Date: Wed, 10 Dec 2003 13:09:42 -0800 From: Amy Roh Subject: Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/session StandardManager.java To: Tomcat Developers List Message-id: <017201c3bf61$ee6ab790$0500a8c0@AMYROH> MIME-version: 1.0 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Mailer: Microsoft Outlook Express 6.00.2800.1158 Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: 8BIT X-Priority: 3 X-MSMail-priority: Normal References: <20031205092855.69272.qmail@minotaur.apache.org> <3FD66185.60406@apache.org> <3FD67BA0.40900@apache.org> X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N > Amy Roh wrote: > > remm@apache.org wrote: > > > >> remm 2003/12/05 01:28:55 > >> > >> Modified: catalina/src/share/org/apache/catalina/session > >> StandardManager.java > >> Log: > >> - isValid already expires sessions, so backgroundProcess shouldn't call > >> expire again. > > > > isValid doesn't *always* expire session. > > > > StandardSession.isValid() - > > > > public boolean isValid() { > > > > if (this.expiring){ > > return true; > > } > > > > if (!this.isValid ) { > > *** return false; > > } > > > > if (maxInactiveInterval >= 0) { > > long timeNow = System.currentTimeMillis(); > > int timeIdle = (int) ((timeNow - lastAccessedTime) / 1000L); > > if (timeIdle >= maxInactiveInterval) { > > *** expire(true); > > } > > } > > > > return (this.isValid); > > } > > > > If StandardSession.isValid is false, then we want to expire the session. > > However, isValid() call doesn't get to expire(true) and just return > > false. So removing session.expire() from > > StandardManager.processExpires() won't work all the time. Am I missing > > something? > > There doesn't seem many methods changing isValid to false. invalidate is > another one, and it calls expire. As long as all the methods which > invalidate the session right away expire them, it should be ok I think. IMHO, not calling expire() because no method changes isValid to false doesn't seem like a clean approach. Moreover, PersistentManagerBase.processExpires() keeps expire() making it not consistent. Amy > > R�my > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org > For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org