Re: [enhydra] Servlet container and session IDs

Slobodan Vujasinovic <[email protected]> Thu, 04 Aug 2005 10:05:56 +0200
Newsgroups gmane.comp.java.enhydra.general
Organization PROZONE
Message-ID <[email protected]>
This is a multi-part message in MIME format...

------------=_1123142899-24000-21
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hi Edgar,

you are completely right!

"StandardSessionManager" and "SimpleServletSessionManager" support 
'SessionHome' parameter (logic).
"SimpleServletSessionManager" is "StandardSessionManager" extension with 
reimplemented 'createSession(HttpPresentationComms comms)' method (seems 
to be doing just what you need -  initializes new session with session 
ID taken from requests HttpSession (initialized by Tomcat)).

Container adapter SessionManager group 
("ContainerAdapterSessionManager", "JmxContainerAdapterSessionManager" 
and new "TomcatContainerAdapterSessionManager") are doing servlet 
container (Tomcat) SessionManager wrapping and (therefore) do not 
support 'SessionHome' parameter (it is ignored).

So, if you want to use your custom SessionHome implementation you will 
have to chose between
"StandardSessionManager" and "SimpleServletSessionManager" 
implementations (or you can develop custom Sessionmanager implementation 
- Enhydra 6.x (EAF 6.x) supports 'SessionManager/Class' attribute). 
"SimpleServletSessionManager" is called simple because it is not 
generating SessionID (it takes one from requests HTTPSession generated 
by servlet container (Tomcat) itself) - just what you need : ) ).

Note that, EAF 6.5-1 has improved 'Container Adapter Session Manager' 
group (comparing to EAF 6.4-1). Basically, this is the only thing done 
here (since 6.4-1 release). Since you are using 
"SimpleServletSessionManager" implementation, you don't have any 
particular reason to upgrade (existing) EAF 6.4-1.

Regards,
  Slobodan Vujasinovic
Enhydra Development Team



Edgar Alves wrote:

>Hi all,
>  I'm trying to setup two Enhydra (6.4-1) servers with an Apache
>(2.0.54) / mod_jk (1.2.14) server load-balancing traffic.
>  I've had problems getting this to work because the webapp I was
>interested in serving was configured to use
>'com.lutris.appserver.server.sessionEnhydra.StandardSessionManager'. The
>problem is that this session manager ignores the jvmRoute attribute of
>the Engine element (in server.xml). So mod_jk didn't have a chance to
>keep session affinity when performing the load-balancing.
>  As suggested by Slobodan, I changed the web.xml for the webapp so that
>'com.lutris.appserver.server.sessionContainerAdapter.JmxContainerAdapterSessionManager'
>would be used instead of
>'com.lutris.appserver.server.sessionEnhydra.StandardSessionManager'.
>After this change the session IDs were generated by the servlet
>container, so they had the jvmRoute appended to them, which allowed
>mod_jk to do its work.
>  However, I found out that
>'com.lutris.appserver.server.sessionContainerAdapter.JmxContainerAdapterSessionManager'
>will not use custom SessionHome's. i.e., the following entries don't
>have any effect:
>    <env-entry>
>      <env-entry-name>SessionManager/SessionHome/Mode</env-entry-name>
>      <env-entry-value>CUSTOM</env-entry-value>
>      <env-entry-type>java.lang.String</env-entry-type>
>    </env-entry>
>    <env-entry>
>      <env-entry-name>SessionManager/SessionHome/Class</env-entry-name>
>      <env-entry-value>com.whatever.CustomSessionHome</env-entry-value>
>      <env-entry-type>java.lang.String</env-entry-type>
>    </env-entry>
>  After looking through the documentation I've noticed
>'com.lutris.appserver.server.sessionEnhydra.SimpleServletSessionManager'.
>I've changed the configuration to use this class as session manager and
>everything seems to be running smoothly (our custom SessionHome is being
>used and the session IDs used are the ones generated by the servlet
>container).
>  Does
>'com.lutris.appserver.server.sessionEnhydra.SimpleServletSessionManager'
>behave like
>'com.lutris.appserver.server.sessionEnhydra.StandardSessionManager'
>except in session ID handling? I'm guessing that that's the only
>difference between the two: the former uses the session ID generated by
>the servlet container (thus having the jvmRoute info that mod_jk needs),
>the latter generates the sessions IDs itself (and is oblivious to the
>jvmRoute attribute). Am I right?
>  Regarding EAF 6.5-1: will
>'com.lutris.appserver.server.sessionContainerAdapter.TomcatContainerAdapterSessionManager'
>behave like
>'com.lutris.appserver.server.sessionContainerAdapter.JmxContainerAdapterSessionManager'?
>I.e., will it ignore the SessionHome settings that
>'SimpleServletSessionManager' and 'StandardSessionManager' use? If so,
>then 'SimpleServletSessionManager' will still (in Enhydra 6.5) be the
>session manager to use if I want the features of Enhydra
>'StandardSessionManager' using session IDs generated by the servlet
>container, right?
>  Best regards,
>
>    -- Edgar Alves
>
>
>
>  
>
>------------------------------------------------------------------------
>
>
>--
>You receive this message as a subscriber of the [email protected] mailing list.
>To unsubscribe: mailto:[email protected]
>For general help: mailto:[email protected]?subject=help
>ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>  
>


------------=_1123142899-24000-21
Content-Type: text/plain; name="message-footer.txt"
Content-Disposition: inline; filename="message-footer.txt"
Content-Transfer-Encoding: 8bit


--
You receive this message as a subscriber of the [email protected] mailing list.
To unsubscribe: mailto:[email protected]
For general help: mailto:[email protected]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws

------------=_1123142899-24000-21--