You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openwebbeans.apache.org by "Joe Bergmark (JIRA)" <ji...@apache.org> on 2015/04/20 15:04:58 UTC

[jira] [Commented] (OWB-1048) Store @SessionScoped beans in real HttpSession if available

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

Joe Bergmark commented on OWB-1048:
-----------------------------------

A few thoughts:

1) Should we store a context map in the session, or store individual session scoped beans with some OWB specific prefix appended to the name?

2) If we go with a map for #1 above, we may need to be careful how we synchronize access to it.

3) We also need to consider how the servlet container might decide when to persist session attributes for purposes of failover.  I'm aware of at least two approaches, one that persists at the end of servlet service, and another the persists on a timer.  Timer based approaches may consider a session attribute untouched if setAttribute has not been called on it again.  If we are placing a mutable map into the session, and then adding things to that map there is some risk of the servlet container not realizing it needs persist a newer copy of the map when it reaches the timer interval again.

Servlet spec section 7.7.2 doesn't provide a lot of promises here so I suspect the behavior can vary greatly by implementation.

> Store @SessionScoped beans in real HttpSession if available
> -----------------------------------------------------------
>
>                 Key: OWB-1048
>                 URL: https://issues.apache.org/jira/browse/OWB-1048
>             Project: OpenWebBeans
>          Issue Type: Improvement
>          Components: Context and Scopes
>    Affects Versions: 1.5.0
>            Reporter: Mark Struberg
>             Fix For: 1.5.1
>
>
> Currently we always store our @SessionScoped beans in a Map<String sessionId, Map<beanbags>> in memory. 
> This causes some nasty issues with sessionId rewrites. We also need the pretty complicated FailOver handling for enabling sane cluster behaviour. 
> We do not need any of those things if we utilize the real HttpSession IF available. That means we do still use a mem-backed Map for owb-core, but provide a different SessionContext impl in the owb-web module.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)