[cdi-dev] [JBoss JIRA] (CDI-732) Clarify that the Context for RequestScoped must be active during @PreDestroy calls

Romain Manni-Bucau (JIRA) issues at jboss.org
Mon Jul 16 03:05:00 EDT 2018

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

Romain Manni-Bucau commented on CDI-732:

[~struberg] this doesn't solve the problem correctly IMHO. request = thread scope is an abuse of users but not what is the scope normally. A lot of usages are about request = ... request :). If you think about an audit implementation by request you breaks it if the request scope is not the last one destroyed so I think session should be destroyed before the request in any case. Having 2 instances in the same real servlet request would be very misleading and pretty much unusable at all stages (perf, understanding, impl).

> Clarify that the Context for RequestScoped must be active during @PreDestroy calls
> ----------------------------------------------------------------------------------
>                 Key: CDI-732
>                 URL: https://issues.jboss.org/browse/CDI-732
>             Project: CDI Specification Issues
>          Issue Type: Feature Request
>          Components: Contexts
>    Affects Versions: 2.0 .Final
>            Reporter: Mark Struberg
> We have the explicit rule that the Context for @RequestScoped must be active during @PostConstruct of any bean. 
> But it seems we don't force the same for invocations of @PreDestroy methods.
> That's especially weird since a few containers now blow up during a destroyal of a @SessionScopedBean which has a @RequestScoped Principal injected, even if the session destroyal was triggered by an explicit Session#invalidate() call in an open HTTP request.

This message was sent by Atlassian JIRA

More information about the cdi-dev mailing list