You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openwebbeans.apache.org by "Sven Linstaedt (JIRA)" <ji...@apache.org> on 2009/11/20 15:57:39 UTC

[jira] Created: (OWB-173) Singleton context is not set as ThreadLocal on every request

Singleton context is not set as ThreadLocal on every request
------------------------------------------------------------

                 Key: OWB-173
                 URL: https://issues.apache.org/jira/browse/OWB-173
             Project: OpenWebBeans
          Issue Type: Bug
            Reporter: Sven Linstaedt
            Assignee: Gurkan Erdogdu


THe Singleton context exists similar to the ApplicationContext as a ThreadLocal. But unlike the last, it is not set on the ThreadLocal on every request, resulting in Singleton beans not being available.

Solution:
reinitialize singleton context like it is done with the application context in ContextFactory.initRequestContext():112

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


[jira] Commented: (OWB-173) Singleton context is not set as ThreadLocal on every request

Posted by "Sven Linstaedt (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OWB-173?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12780581#action_12780581 ] 

Sven Linstaedt commented on OWB-173:
------------------------------------

The SingletonContext needs to be remembered somewhere, of course. A static field might be a solution, but is inadequate for EE environments in which multiple web applications are deployed.  IMHO SingletonContext should be rather stored in the ServletContext.

> Singleton context is not set as ThreadLocal on every request
> ------------------------------------------------------------
>
>                 Key: OWB-173
>                 URL: https://issues.apache.org/jira/browse/OWB-173
>             Project: OpenWebBeans
>          Issue Type: Bug
>            Reporter: Sven Linstaedt
>            Assignee: Gurkan Erdogdu
>
> THe Singleton context exists similar to the ApplicationContext as a ThreadLocal. But unlike the last, it is not set on the ThreadLocal on every request, resulting in Singleton beans not being available.
> Solution:
> reinitialize singleton context like it is done with the application context in ContextFactory.initRequestContext():112

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


[jira] Closed: (OWB-173) Singleton context is not set as ThreadLocal on every request

Posted by "Gurkan Erdogdu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OWB-173?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gurkan Erdogdu closed OWB-173.
------------------------------

       Resolution: Fixed
    Fix Version/s: M4

Actually JSR-299 does not define how to use Singleton scoped because it is not defined as Normal scoped type. But I have updated implementation that each servlet context owns its singleton context as you indicated.

> Singleton context is not set as ThreadLocal on every request
> ------------------------------------------------------------
>
>                 Key: OWB-173
>                 URL: https://issues.apache.org/jira/browse/OWB-173
>             Project: OpenWebBeans
>          Issue Type: Bug
>            Reporter: Sven Linstaedt
>            Assignee: Gurkan Erdogdu
>             Fix For: M4
>
>
> THe Singleton context exists similar to the ApplicationContext as a ThreadLocal. But unlike the last, it is not set on the ThreadLocal on every request, resulting in Singleton beans not being available.
> Solution:
> reinitialize singleton context like it is done with the application context in ContextFactory.initRequestContext():112

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