deltaspike-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Struberg (JIRA)" <>
Subject [jira] [Resolved] (DELTASPIKE-293) Improve the ViewScopedContext by observing ServletContext and HttpSession lifecycle events.
Date Sun, 26 May 2013 19:47:20 GMT


Mark Struberg resolved DELTASPIKE-293.

    Resolution: Won't Fix
      Assignee: Mark Struberg


I think this is not easily fixable. The ViewMap might as well be stored on the ClientSide.
Thus we just have no idea whether we do have a session boundary at all, etc. Please note that
the destroyal of any Serializable bean is not a 100% safe bet. 
E.g. even @SessionScoped beans could not be reliable. Just think about the session being serialized
away to another node and then shutting down the server. Or having session-passivation to disk
and then deleting the storage, etc.

We can just rely on the JSF container and hope for the best. In case of MyFaces we will also
get this event if the ViewMap gets destroyed after a SessionTimeout. I'm not sure about Mojarra
> Improve the ViewScopedContext by observing ServletContext and HttpSession lifecycle events.
> -------------------------------------------------------------------------------------------
>                 Key: DELTASPIKE-293
>                 URL:
>             Project: DeltaSpike
>          Issue Type: Improvement
>          Components: JSF-Module
>    Affects Versions: 0.4-incubating
>            Reporter: Radu Creanga
>            Assignee: Mark Struberg
>             Fix For: 0.5
> The CDI specification states that Context implementations are responsible for destroying
instances it creates. The current ViewScopedContext relies on PreDestroyViewMapEvents to be
notified when a view map is destroyed. But, the JSF 2.0 and 2.1 spec only fire this event
when a view map is replaced. This means that in most cases, instances created by ViewScopedContext
are not properly destroyed. The ViewScopedContext should be observing ServletContext and HttpSession
lifecycle events instead in order to ensure that all instances it creates are properly destroyed.
Visible improvements resulting out of this would be that the @PostConstruct method of @ViewScoped
beans is invoked. Additionally, this will probably result in better memory usage, since instances
that are not properly destroyed are not eligible for GC.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message