[ 
https://issues.apache.org/jira/browse/OWB-523?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13004570#comment-13004570
 ] 

Martin Grotzke commented on OWB-523:
------------------------------------

The msm-sample-webapp in openwebbeans branch is defaultet to non-sticky 
sessions - so sessions are swapped out / in for each request. This can be 
changed in runtime/tomcat1/conf/context.xml (sticky="true|false") or by just 
using `./switch-stickyness.sh sticky|nonsticky`.

Regarding the map of SessionContexts: when (nonsticky) sessions are only 
"deregistered" via "sessionWillPassivate" OWB will never get some 
sessionDestroyed event. This sounds as this would be a session/memory leak with 
nonsticky sessions.

The following two paragraphs from the servlet spec 2.4 IMHO say that you can't 
rely on session lifecycle events but the HttpSessionActivationListener in a 
distributed environment:


SRV.7.7.2 Distributed Environments

[..]

Containers must notify any session attributes implementing the 
HttpSessionActivationListener during migration of a session. They must notify 
listeners of passivation prior to serialization of a session, and of activation 
after deserialization of a session.

SRV.10.7 Distributed Containers

In distributed Web containers, HttpSession instances are scoped to the 
particular JVM servicing session requests, and the ServletContext object is 
scoped to the Web container’s JVM. Distributed containers are not required to 
propagate either servlet context events or HttpSession events to other JVMs. 
Listener class instances are scoped to one per deployment descriptor 
declaration per Java Virtual Machine.

> @SessionScoped bean failover does not work
> ------------------------------------------
>
>                 Key: OWB-523
>                 URL: https://issues.apache.org/jira/browse/OWB-523
>             Project: OpenWebBeans
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.0
>         Environment: MyFaces 2.0.3, OWB 1.0.0, Tomcat 7.0.8, 
> memcached-session-manager
>            Reporter: Thomas Andraschko
>            Assignee: Joe Bergmark
>            Priority: Minor
>
> OWB failover for @SessionScoped beans does not work.
> A detailed description and a sample project can be found here:
> https://github.com/magro/msm-sample-webapp/tree/openwebbeans

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to