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:

http://marc.info/?t=122582031400001&r=1&w=2

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

The changes I applied after the very short discussion were:

http://svn.apache.org/viewvc?rev=711711&view=rev
http://svn.apache.org/viewvc?rev=711714&view=rev
http://svn.apache.org/viewvc?rev=711716&view=rev
http://svn.apache.org/viewvc?rev=711720&view=rev

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
    http://svn.apache.org/viewvc?rev=711695&view=rev
  - Give thisAccessedTime and lastAccessedTime for sessions
    a clear semantics:
    http://svn.apache.org/viewvc?rev=711711&view=rev
    - 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
    http://svn.apache.org/viewvc?rev=711714&view=rev
  - Expose thisAccessedTime via the session interface
    and ManagerBase, so we can use it from outside the session.
    http://svn.apache.org/viewvc?rev=711716&view=rev
  - Make the classes checking session idleness use thisAccessedTime.
    http://svn.apache.org/viewvc?rev=711720&view=rev
    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.

Regards,

Rainer

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to