tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rainer Jung <>
Subject Re: Session.getLastAccessTime() ticking
Date Thu, 22 Sep 2011 09:41:12 GMT
On 21.09.2011 21:15, Mark Thomas wrote:
> On 21/09/2011 19:06, Konstantin Kolinko wrote:
> <snip/>
>> The first question that I have is that I do not see how last access is
>> ticked if there is no explicit request for a session. I think it
>> should be ticked regardless of whether getSession(..) has been called.
> StandardHostValve look for ACCESS_SESSION.
>> 2. Access time in StandardSession is updated using System.currentTimeMillis();
>> The second question that I have is that it contradicts my "b)" point
>> from above. I think it is against the spec.
> On the surface, that looks like a reasonable thing to do but the session
> doesn't have access to the request so the change could be quite invasive.
>> The third question is that there are a lot of places that call
>> access(), and every such call updates thisAccessedTime in
>> StandardSession.
>> It looks like not all such calls are associated with an actual
>> request, and strictly speaking they should not update the time.
> Fair point, but see above.
> Rainer went through all of this some time ago and I thought that he
> brought everything in line with the spec so I am surprised there are so
> many apparent differences. I'd be interested in his views.

I guess you are referring to a 2008 discussion here:

That wasn't driven by SPEC compliance but consistency in general.

The changes I applied after the very short discussion were:

The following backport proposal was added for TC 6 in March 2009 and
contains some more explanations:

* Backport cleanup of semantics of thisAccessedTime and
  lastAccessedTime for sessions:
  - preparational whitespace changes
  - Give thisAccessedTime and lastAccessedTime for sessions
    a clear semantics:
    - thisAccessedTime will be updated at the beginning and
      at the end of session use
    - lastAccessedTime will only be updated at the end of
      session use
    This means:
    - lastAccessedTime is the last access time of a session
      disregarding any request still being processed on.
      So this is good to use even from within a request
      to detect when its own session has been used last before.
    - thisAccessedTime already gets updated when a new request
      disregarding any request still being processed on.
      So this is better for any idleness check or information.
    - thisAccessedTime >= lastAccessedTime always
  - Port from StandardSession to DeltaSession
  - Expose thisAccessedTime via the session interface
    and ManagerBase, so we can use it from outside the session.
  - Make the classes checking session idleness use thisAccessedTime.
    This is not for invalidation, only for displaying
    idle times and making persistance decisions.

I removed it in May, because there were too many objections.



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message