users@glassfish.java.net

Re: Session Management in Glassfish Cluster

From: <Jan.Luehe_at_Sun.COM>
Date: Tue, 23 Oct 2007 20:25:50 -0700

As mentioned earlier, when an HTTP session is created in GlassFish,
only the HttpSessionListener residing on the instance where the
session was created will be notified.

However, this HttpSessionListener could in turn notify all other
instances in the cluster about the session creation, by sending a
corresponding GMS message to them. The same would happen for
sessionDestroyed events.

I'm not sure if this fully answers your question, though.


Jan


Evaristo José Camarero wrote:

>Any help?
>
>
>--- Evaristo José Camarero <evaristojosec_at_yahoo.es>
>escribió:
>
>
>
>>Hi Jan and all:
>>
>>Clarification is included inside the mail
>>
>>Thanks,
>>
>>Evaristo
>>
>>--- Jan.Luehe_at_Sun.COM escribió:
>>
>>
>>
>>>Evaristo,
>>>
>>>
>>>Evaristo José Camarero wrote:
>>>
>>>
>>>
>>>>Hi all:
>>>>
>>>>I am migrating a clustered application from
>>>>
>>>>
>>Tomcat
>>
>>
>>>>5.5.x to Glassfish v2, using HttpSession in
>>>>
>>>>
>>memory
>>
>>
>>>>replication.
>>>>
>>>>The application must be able to work with devices
>>>>
>>>>
>>>not
>>>
>>>
>>>>supporting cookies (e.g. some mobile devices),
>>>>
>>>>
>>and
>>
>>
>>>>even further that URL re-writing capabilities
>>>>
>>>>
>>(get
>>
>>
>>>>sessions by IP address, assuming that each mobile
>>>>device has only a concurrent session).
>>>>
>>>>
>>>>
>>>>
>>>I'm not sure I understand the latter part of the
>>>above sentence:
>>>Are you saying that both cookies *and* URL
>>>
>>>
>>rewriting
>>
>>
>>>have been
>>>disabled in your environment, and the IP address
>>>
>>>
>>of
>>
>>
>>>a device
>>>is used as the id of the session created on the
>>>device (based on
>>>the simplifying assumption that there will be only
>>>
>>>
>>a
>>
>>
>>>single session
>>>per device)?
>>>
>>>Can you please clarify?
>>>
>>>
>>The application is written for mobile phones using
>>iMode. This mobile terminals does not support
>>cookies.
>>
>>Of course URL re-writing is possible, but session is
>>lost if the user change the web site he is
>>navigating.
>>So, in the Tomcat webapp, we were able to maintain
>>the
>>session based on the IP address of the terminal.
>>
>>
>>
>>>Thanks,
>>>
>>>
>>>Jan
>>>
>>>
>>>
>>>>In Tomcat, I have employed the
>>>>
>>>>
>>HttpSessionListeners
>>
>>
>>>to
>>>
>>>
>>>>build a table indexed by the IP address of the
>>>>
>>>>
>>>device
>>>
>>>
>>>>to get the HttpSession. In a Tomcat clustered
>>>>environment, this is working because HttpSessions
>>>>
>>>>
>>>are
>>>
>>>
>>>>replicated to all the cluster nodes, and the
>>>>
>>>>
>>>listeners
>>>
>>>
>>>>are called in all the cluster members.
>>>>
>>>>Glassfish follows a different alternative, and
>>>>therefore I can not build this table, and I can
>>>>
>>>>
>>not
>>
>>
>>>>follow the same approach with Glassfish.
>>>>
>>>>So, is there any possible alternative for doing
>>>>something similar with Glassfish (e.g. using
>>>>
>>>>
>>Shoal
>>
>>
>>>to
>>>
>>>
>>>>get the right session, or using HADB)?
>>>>
>>>>Thanks in advance,
>>>>
>>>>Evaristo
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>____________________________________________________________________________________
>>
>>
>>>>Sé un Mejor Amante del Cine
>>>>
>>>>
>>
>>
>>
>>>>¿Quieres saber cómo? ¡Deja que otras personas te
>>>>
>>>>
>>>ayuden!
>>>
>>>
>>>
>>http://advision.webevents.yahoo.com/reto/entretenimiento.html
>>
>>
>>---------------------------------------------------------------------
>>
>>
>>>>To unsubscribe, e-mail:
>>>>
>>>>
>>>users-unsubscribe_at_glassfish.dev.java.net
>>>
>>>
>>>>For additional commands, e-mail:
>>>>
>>>>
>>>users-help_at_glassfish.dev.java.net
>>>
>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>---------------------------------------------------------------------
>
>
>>>To unsubscribe, e-mail:
>>>users-unsubscribe_at_glassfish.dev.java.net
>>>For additional commands, e-mail:
>>>users-help_at_glassfish.dev.java.net
>>>
>>>
>>>
>>>
>>
>>
>>
>>
>>
>____________________________________________________________________________________
>
>
>>Sé un Mejor Amante del Cine
>>¿Quieres saber cómo? ¡Deja que otras personas te
>>ayuden!
>>
>>
>>
>http://advision.webevents.yahoo.com/reto/entretenimiento.html
>
>
>>
>>
>---------------------------------------------------------------------
>
>
>>To unsubscribe, e-mail:
>>users-unsubscribe_at_glassfish.dev.java.net
>>For additional commands, e-mail:
>>users-help_at_glassfish.dev.java.net
>>
>>
>>
>>
>
>
>
>
>____________________________________________________________________________________
>Sé un Mejor Amante del Cine
>¿Quieres saber cómo? ¡Deja que otras personas te ayuden!
>http://advision.webevents.yahoo.com/reto/entretenimiento.html
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
>For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>
>