You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openwebbeans.apache.org by "YING WANG (JIRA)" <ji...@apache.org> on 2010/04/28 17:49:34 UTC

[jira] Commented: (OWB-363) Intermittent bug with ApplicationScope disposers not being called

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

YING WANG commented on OWB-363:
-------------------------------

Gurkan, Joe, I took a look on the latest change. It could fix the applicationContext is not destroyed issue when shutting down. However, I feel it is still possible that wrong applicationContext gets destroyed in multiple applications env. such as:

T1:  Thread 1 handles App1 and have threadLocal applicationContext(app1)
T2:  Thread 2 handles App2 and have threadLocal applicationContext(app2)
T3:  app2 shutdown by admin and thread 1 handles it, since it has applicationContext(app1), according to current logic in destroyApplicationContext, app1's applicationContext get destroyed.  (I didn't find applicationContext get reset after each request.)

How about directly extract applicationContext from currentApplicationContexts(serveletContext) and do not use threadLocal one in destroyApplicationcontext () or make applicationContext a non-threadLocal, non-static variable like Joe said? 



> Intermittent bug with ApplicationScope disposers not being called
> -----------------------------------------------------------------
>
>                 Key: OWB-363
>                 URL: https://issues.apache.org/jira/browse/OWB-363
>             Project: OpenWebBeans
>          Issue Type: Bug
>          Components: Context and Scopes
>    Affects Versions: M4
>            Reporter: Joe Bergmark
>            Assignee: Gurkan Erdogdu
>            Priority: Minor
>             Fix For: 1.0.0
>
>
> While testing an application have seen an issue where disposers for application scoped producer methods are not called.  Took a quick peek at the WebContextService, and I suspect the ThreadLocal may not be correct for the thread that is handling the application stop.
> It seems to me that we already have a 1:1 mapping of WebContextService (loaded based on the classloader by WebBeansFinder) to the application, so we could probably make the ApplicationContext field non-static and non-threadlocal.

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