You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openwebbeans.apache.org by "Mark Struberg (JIRA)" <ji...@apache.org> on 2018/08/23 08:30:00 UTC

[jira] [Commented] (OWB-1252) WebContextsService lazyStartRequestContext fails on first access.

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

Mark Struberg commented on OWB-1252:
------------------------------------

Right now our WebContextsService smells a bit fishy anyway.

 

{{{color:#000080}public {color}Context getCurrentContext(Class<? {color:#000080}extends {color}Annotation> scopeType) }}

{{vs}}

{{{color:#000080}public {color}Context getCurrentContext(Class<? {color:#000080}extends {color}Annotation> scopeType, {color:#000080}boolean {color}createIfNotExists)}}

 

The first one calls

{{{color:#000080}return {color}getRequestContext({color:#000080}true{color}); }}

which is imo wrong as the javadoc clearly says that NO context will get created if not exists!

> WebContextsService lazyStartRequestContext fails on first access.
> -----------------------------------------------------------------
>
>                 Key: OWB-1252
>                 URL: https://issues.apache.org/jira/browse/OWB-1252
>             Project: OpenWebBeans
>          Issue Type: Improvement
>          Components: Context and Scopes
>    Affects Versions: 2.0.6
>            Reporter: Mark Struberg
>            Assignee: Mark Struberg
>            Priority: Major
>             Fix For: 2.0.7
>
>
> As reported by Tamas Kimmel on our mailing list
> [https://lists.apache.org/thread.html/e3490fa84afa06b95a776ef34f9c8d9aee9fe662d150680a346b37ba@%3Cuser.openwebbeans.apache.org%3E]
>  
> It seems that WebContextsService#getRequestContext does lazily create the RequestContext for a Thread, but does not return the created Context for the first invocation but only on subsequent invocations.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)