struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Van Wart <sc...@indosoft.com>
Subject Re: HttpSession facade
Date Tue, 29 Aug 2006 23:12:31 GMT
Madhav Bhargava wrote:
> I was going thru the struts source code and was in particular reading the
> way they have implemented the synchronizer token pattern for preventing
> multiple submits on transacional pages.
>
> I saw that they have synchronized on session ID attribute. Is it possible
> that multiple session share the same session ID? There is noting in the
> servlet API that mandates it.
All I know is from tinkering around in the source myself.  I think the 
idea behind a session facade is to provide a bridge between your typical 
session (want a session, get a session), and expected behavior in a 
clustered or multi-VM environment.  In the latter case you might have 
two physical computers that process two different requests from the same 
user (with the same ID).  The session needs to be serialized and sent 
between computers so each computer behaves as if they know about the 
original session equally well.  Rather than sending every bit of session 
information to every machine (or in smaller environments, every 
process), the "session facade" handles management of session information 
in case this session information needs to be shared with another provider.

Wow, that was fun.  Anyways, while two or more users WON'T share the 
same session ID, the stuff still needs to be synchronized.  One web 
request might be writing information to the session while another is 
trying to read it to service a subsequent request from the same user.

- Scott

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message