[ 
https://issues.apache.org/jira/browse/MYFACES-2485?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12800198#action_12800198
 ] 

Bernhard Huemer commented on MYFACES-2485:
------------------------------------------

What I'm saying is basically don't try to mess with the container. If it really 
turns out to be an issue, it's definitely container related and has nothing to 
do with MyFaces (and I'd even suggest not to work around that issue in this 
case, because we'd possibly mess up things regarding holding invalid references 
and so on ..). It's the container's responsibility to invalidate the session 
properly. If the user doesn't like the serialization-default he just has to 
configure Tomcat accordingly and I just presume that the session callbacks will 
then be called once the container shuts down (otherwise I'd consider this as a 
container bug probably). So why am I against working around this, if it really 
turns out be an issue? Well, basically because destructing session beans solves 
that issue only partly, what about the StateManager's views? What about 
basically everything else that's in the session?

Regarding the view and request scoped beans, well if you're able to find a 
request scoped bean that hasn't been destroyed once the container shuts down 
(assuming that there is no active request), congratulations, you've found 
another container bug. View-scoped beans are probably somehow saved in the 
user's session, aren't they (sorry, I don't know JSF 2.0 very well)? If that's 
the case, you don't even have to consider it, because what I've written above 
just applies to these beans as well (i.e. don't try to mess with the 
container's responsibilities).

> Ensure invocation of @PreDestroy methods on container shutdown/restart
> ----------------------------------------------------------------------
>
>                 Key: MYFACES-2485
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2485
>             Project: MyFaces Core
>          Issue Type: Improvement
>    Affects Versions: 2.0.0-alpha
>            Reporter: Jakob Korherr
>
> Because of the fact that only ServletContextListener.contextDestroyed() is 
> invoked on a container shutdown/restart, the correct destruction of 
> ManagedBeans in session, view and request scope is not ensured.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to