[cdi-dev] [JBoss JIRA] (CDI-730) The order in which contexts are destroyed is undefined.

Mark Struberg (JIRA) issues at jboss.org
Mon Jul 16 04:11:00 EDT 2018

    [ https://issues.jboss.org/browse/CDI-730?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13605310#comment-13605310 ] 

Mark Struberg commented on CDI-730:

I understand the argument that the order is really hard to get right.
But I would love if we could clarify the following:

* When a request ends, first ALL the @BeforeDestroyed events for the following contexts are sent: RequestScope, ConversationScoped (if context ends), SessionScoped (if session ends)
* Only after that the proper @PreDestroy methods are called on all those scopes.

PS: the deferral of the session destroy to the end of the request is a left over of the (failed) Seam2 compatibility mode. It should have never be done that way and really causes tons of problems :(
In OWB there is even a way to turn this off and make it follow the standard Servlets Sesion lifecycle because it caused so many problems.

> The order in which contexts are destroyed is undefined.
> -------------------------------------------------------
>                 Key: CDI-730
>                 URL: https://issues.jboss.org/browse/CDI-730
>             Project: CDI Specification Issues
>          Issue Type: Clarification
>    Affects Versions: 2.Future, 1.2.Final, 2.0 .Final
>            Reporter: Benjamin Confino
>            Priority: Minor
> The order in which contexts are destroyed is not defined in the spec, I believe this should be made explicit.
> At present weld destroys conversation, request, then session context in that order. I think this should become the standard and written into the spec.
> For background there is this email by Martin Kouba: http://lists.jboss.org/pipermail/weld-dev/2018-June/003694.html

This message was sent by Atlassian JIRA

More information about the cdi-dev mailing list