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 2010/04/12 12:23:41 UTC

[jira] Created: (OWB-351) OWB picks up @SessionScoped contextual instances from expired sessions

OWB picks up @SessionScoped contextual instances from expired sessions
----------------------------------------------------------------------

                 Key: OWB-351
                 URL: https://issues.apache.org/jira/browse/OWB-351
             Project: OpenWebBeans
          Issue Type: Bug
          Components: Context and Scopes
    Affects Versions: M4
            Reporter: Mark Struberg
            Assignee: Mark Struberg
            Priority: Critical
             Fix For: 1.0.0


We currently store the CreationalContext instance from creating time inside the NormalScopedBeanInterceptorHandler.

This leads to the fact that we pickup the contextual instance stored in that very CreationalContext even if the context itself is long time gone (e.g. if the session expired. This also leads to the side effect that we currently pickup contextual instances from the wrong session if the proxy gets injected into a wider scoped instance (e.g. an @ApplicationScoped bean).

Thus, we must drop the CreationalContext from all our NormalScoped proxies and create a new CreationalContext each time we create a new contextual instance.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (OWB-351) OWB picks up @SessionScoped contextual instances from expired sessions

Posted by "Gurkan Erdogdu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OWB-351?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12855994#action_12855994 ] 

Gurkan Erdogdu commented on OWB-351:
------------------------------------

This is problem because of not clearing CreationalContextImpl enough. I will update it

> OWB picks up @SessionScoped contextual instances from expired sessions
> ----------------------------------------------------------------------
>
>                 Key: OWB-351
>                 URL: https://issues.apache.org/jira/browse/OWB-351
>             Project: OpenWebBeans
>          Issue Type: Bug
>          Components: Context and Scopes
>    Affects Versions: M4
>            Reporter: Mark Struberg
>            Assignee: Mark Struberg
>            Priority: Blocker
>             Fix For: 1.0.0
>
>
> We currently store the CreationalContext instance from creating time inside the NormalScopedBeanInterceptorHandler.
> This leads to the fact that we pickup the contextual instance stored in that very CreationalContext even if the context itself is long time gone (e.g. if the session expired. This also leads to the side effect that we currently pickup contextual instances from the wrong session if the proxy gets injected into a wider scoped instance (e.g. an @ApplicationScoped bean).
> Thus, we must drop the CreationalContext from all our NormalScoped proxies and create a new CreationalContext each time we create a new contextual instance.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Reopened: (OWB-351) OWB picks up @SessionScoped contextual instances from expired sessions

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

Mark Struberg reopened OWB-351:
-------------------------------


it seems that the cyclic reference in @PostConstruct functions need to be supported. 
At least that's what the TCK test CircularDependencyTest does.

> OWB picks up @SessionScoped contextual instances from expired sessions
> ----------------------------------------------------------------------
>
>                 Key: OWB-351
>                 URL: https://issues.apache.org/jira/browse/OWB-351
>             Project: OpenWebBeans
>          Issue Type: Bug
>          Components: Context and Scopes
>    Affects Versions: M4
>            Reporter: Mark Struberg
>            Assignee: Mark Struberg
>            Priority: Blocker
>             Fix For: 1.0.0
>
>
> We currently store the CreationalContext instance from creating time inside the NormalScopedBeanInterceptorHandler.
> This leads to the fact that we pickup the contextual instance stored in that very CreationalContext even if the context itself is long time gone (e.g. if the session expired. This also leads to the side effect that we currently pickup contextual instances from the wrong session if the proxy gets injected into a wider scoped instance (e.g. an @ApplicationScoped bean).
> Thus, we must drop the CreationalContext from all our NormalScoped proxies and create a new CreationalContext each time we create a new contextual instance.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (OWB-351) OWB picks up @SessionScoped contextual instances from expired sessions

Posted by "Mark Struberg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OWB-351?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12855987#action_12855987 ] 

Mark Struberg commented on OWB-351:
-----------------------------------

In fact the Context is really destroyed, but our proxy still holds the original CreationalContext. And there the 'old' contextual instance is stored.
I've commited the unit test which shows the problem.

> OWB picks up @SessionScoped contextual instances from expired sessions
> ----------------------------------------------------------------------
>
>                 Key: OWB-351
>                 URL: https://issues.apache.org/jira/browse/OWB-351
>             Project: OpenWebBeans
>          Issue Type: Bug
>          Components: Context and Scopes
>    Affects Versions: M4
>            Reporter: Mark Struberg
>            Assignee: Mark Struberg
>            Priority: Blocker
>             Fix For: 1.0.0
>
>
> We currently store the CreationalContext instance from creating time inside the NormalScopedBeanInterceptorHandler.
> This leads to the fact that we pickup the contextual instance stored in that very CreationalContext even if the context itself is long time gone (e.g. if the session expired. This also leads to the side effect that we currently pickup contextual instances from the wrong session if the proxy gets injected into a wider scoped instance (e.g. an @ApplicationScoped bean).
> Thus, we must drop the CreationalContext from all our NormalScoped proxies and create a new CreationalContext each time we create a new contextual instance.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (OWB-351) OWB picks up @SessionScoped contextual instances from expired sessions

Posted by "Mark Struberg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OWB-351?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12856094#action_12856094 ] 

Mark Struberg commented on OWB-351:
-----------------------------------

this got removed intentionally because it is usually not necessary and had problematic side effects like picking up the wrong contextual instance if used in multithreaded scenarios.

If cyclic @PostConstruct and @Inject methods must not occur (as defined in JSR-250), we can either drop it completely. If not we must only use this very CreationalContext until we leave Contextual<T>#create() and must not use it later if the application  uses the proxy!

> OWB picks up @SessionScoped contextual instances from expired sessions
> ----------------------------------------------------------------------
>
>                 Key: OWB-351
>                 URL: https://issues.apache.org/jira/browse/OWB-351
>             Project: OpenWebBeans
>          Issue Type: Bug
>          Components: Context and Scopes
>    Affects Versions: M4
>            Reporter: Mark Struberg
>            Assignee: Mark Struberg
>            Priority: Blocker
>             Fix For: 1.0.0
>
>
> We currently store the CreationalContext instance from creating time inside the NormalScopedBeanInterceptorHandler.
> This leads to the fact that we pickup the contextual instance stored in that very CreationalContext even if the context itself is long time gone (e.g. if the session expired. This also leads to the side effect that we currently pickup contextual instances from the wrong session if the proxy gets injected into a wider scoped instance (e.g. an @ApplicationScoped bean).
> Thus, we must drop the CreationalContext from all our NormalScoped proxies and create a new CreationalContext each time we create a new contextual instance.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (OWB-351) OWB picks up @SessionScoped contextual instances from expired sessions

Posted by "Gurkan Erdogdu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OWB-351?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12856000#action_12856000 ] 

Gurkan Erdogdu commented on OWB-351:
------------------------------------

I have update, now test is working

> OWB picks up @SessionScoped contextual instances from expired sessions
> ----------------------------------------------------------------------
>
>                 Key: OWB-351
>                 URL: https://issues.apache.org/jira/browse/OWB-351
>             Project: OpenWebBeans
>          Issue Type: Bug
>          Components: Context and Scopes
>    Affects Versions: M4
>            Reporter: Mark Struberg
>            Assignee: Mark Struberg
>            Priority: Blocker
>             Fix For: 1.0.0
>
>
> We currently store the CreationalContext instance from creating time inside the NormalScopedBeanInterceptorHandler.
> This leads to the fact that we pickup the contextual instance stored in that very CreationalContext even if the context itself is long time gone (e.g. if the session expired. This also leads to the side effect that we currently pickup contextual instances from the wrong session if the proxy gets injected into a wider scoped instance (e.g. an @ApplicationScoped bean).
> Thus, we must drop the CreationalContext from all our NormalScoped proxies and create a new CreationalContext each time we create a new contextual instance.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (OWB-351) OWB picks up @SessionScoped contextual instances from expired sessions

Posted by "Gurkan Erdogdu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OWB-351?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12856083#action_12856083 ] 

Gurkan Erdogdu commented on OWB-351:
------------------------------------

Commits on interceptor handlers eat the client provided CreationalContext in the BeanManager#getReference(...CreationalContext)

> OWB picks up @SessionScoped contextual instances from expired sessions
> ----------------------------------------------------------------------
>
>                 Key: OWB-351
>                 URL: https://issues.apache.org/jira/browse/OWB-351
>             Project: OpenWebBeans
>          Issue Type: Bug
>          Components: Context and Scopes
>    Affects Versions: M4
>            Reporter: Mark Struberg
>            Assignee: Mark Struberg
>            Priority: Blocker
>             Fix For: 1.0.0
>
>
> We currently store the CreationalContext instance from creating time inside the NormalScopedBeanInterceptorHandler.
> This leads to the fact that we pickup the contextual instance stored in that very CreationalContext even if the context itself is long time gone (e.g. if the session expired. This also leads to the side effect that we currently pickup contextual instances from the wrong session if the proxy gets injected into a wider scoped instance (e.g. an @ApplicationScoped bean).
> Thus, we must drop the CreationalContext from all our NormalScoped proxies and create a new CreationalContext each time we create a new contextual instance.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (OWB-351) OWB picks up @SessionScoped contextual instances from expired sessions

Posted by "Gurkan Erdogdu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OWB-351?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12855985#action_12855985 ] 

Gurkan Erdogdu commented on OWB-351:
------------------------------------

In session destruction, we destroy context and creational context. How could you get a wrong creational context? Could you look at WebBeansConfigurationListener#sessionDestroyed.

If proxy is in ApplicationScopedBean, then instance is recreated on invoking this bean because old context is already destroyed.

COuld you attach a code to this issue?

> OWB picks up @SessionScoped contextual instances from expired sessions
> ----------------------------------------------------------------------
>
>                 Key: OWB-351
>                 URL: https://issues.apache.org/jira/browse/OWB-351
>             Project: OpenWebBeans
>          Issue Type: Bug
>          Components: Context and Scopes
>    Affects Versions: M4
>            Reporter: Mark Struberg
>            Assignee: Mark Struberg
>            Priority: Blocker
>             Fix For: 1.0.0
>
>
> We currently store the CreationalContext instance from creating time inside the NormalScopedBeanInterceptorHandler.
> This leads to the fact that we pickup the contextual instance stored in that very CreationalContext even if the context itself is long time gone (e.g. if the session expired. This also leads to the side effect that we currently pickup contextual instances from the wrong session if the proxy gets injected into a wider scoped instance (e.g. an @ApplicationScoped bean).
> Thus, we must drop the CreationalContext from all our NormalScoped proxies and create a new CreationalContext each time we create a new contextual instance.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (OWB-351) OWB picks up @SessionScoped contextual instances from expired sessions

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

Mark Struberg updated OWB-351:
------------------------------

    Priority: Blocker  (was: Critical)

upgrade to blocker, since we get the wrong contextual instances -> this will break every app running in multithreaded

> OWB picks up @SessionScoped contextual instances from expired sessions
> ----------------------------------------------------------------------
>
>                 Key: OWB-351
>                 URL: https://issues.apache.org/jira/browse/OWB-351
>             Project: OpenWebBeans
>          Issue Type: Bug
>          Components: Context and Scopes
>    Affects Versions: M4
>            Reporter: Mark Struberg
>            Assignee: Mark Struberg
>            Priority: Blocker
>             Fix For: 1.0.0
>
>
> We currently store the CreationalContext instance from creating time inside the NormalScopedBeanInterceptorHandler.
> This leads to the fact that we pickup the contextual instance stored in that very CreationalContext even if the context itself is long time gone (e.g. if the session expired. This also leads to the side effect that we currently pickup contextual instances from the wrong session if the proxy gets injected into a wider scoped instance (e.g. an @ApplicationScoped bean).
> Thus, we must drop the CreationalContext from all our NormalScoped proxies and create a new CreationalContext each time we create a new contextual instance.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (OWB-351) OWB picks up @SessionScoped contextual instances from expired sessions

Posted by "Mark Struberg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OWB-351?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12856075#action_12856075 ] 

Mark Struberg commented on OWB-351:
-----------------------------------

There is currently a discussion ongoing if cyclic references in @PostConstruct methods are allowed for JSR-299 (they are forbidden in JSR-250 afaik): https://jira.jboss.org/jira/browse/CDITCK-140

> OWB picks up @SessionScoped contextual instances from expired sessions
> ----------------------------------------------------------------------
>
>                 Key: OWB-351
>                 URL: https://issues.apache.org/jira/browse/OWB-351
>             Project: OpenWebBeans
>          Issue Type: Bug
>          Components: Context and Scopes
>    Affects Versions: M4
>            Reporter: Mark Struberg
>            Assignee: Mark Struberg
>            Priority: Blocker
>             Fix For: 1.0.0
>
>
> We currently store the CreationalContext instance from creating time inside the NormalScopedBeanInterceptorHandler.
> This leads to the fact that we pickup the contextual instance stored in that very CreationalContext even if the context itself is long time gone (e.g. if the session expired. This also leads to the side effect that we currently pickup contextual instances from the wrong session if the proxy gets injected into a wider scoped instance (e.g. an @ApplicationScoped bean).
> Thus, we must drop the CreationalContext from all our NormalScoped proxies and create a new CreationalContext each time we create a new contextual instance.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Closed: (OWB-351) OWB picks up @SessionScoped contextual instances from expired sessions

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

Gurkan Erdogdu closed OWB-351.
------------------------------

    Resolution: Fixed

I think this issue has solved.

> OWB picks up @SessionScoped contextual instances from expired sessions
> ----------------------------------------------------------------------
>
>                 Key: OWB-351
>                 URL: https://issues.apache.org/jira/browse/OWB-351
>             Project: OpenWebBeans
>          Issue Type: Bug
>          Components: Context and Scopes
>    Affects Versions: M4
>            Reporter: Mark Struberg
>            Assignee: Mark Struberg
>            Priority: Blocker
>             Fix For: 1.0.0
>
>
> We currently store the CreationalContext instance from creating time inside the NormalScopedBeanInterceptorHandler.
> This leads to the fact that we pickup the contextual instance stored in that very CreationalContext even if the context itself is long time gone (e.g. if the session expired. This also leads to the side effect that we currently pickup contextual instances from the wrong session if the proxy gets injected into a wider scoped instance (e.g. an @ApplicationScoped bean).
> Thus, we must drop the CreationalContext from all our NormalScoped proxies and create a new CreationalContext each time we create a new contextual instance.

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


[jira] Commented: (OWB-351) OWB picks up @SessionScoped contextual instances from expired sessions

Posted by "Mark Struberg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OWB-351?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12856006#action_12856006 ] 

Mark Struberg commented on OWB-351:
-----------------------------------

Txs, the incompleteInstance was another source of woes. I think we now come really close to a final solution.

> OWB picks up @SessionScoped contextual instances from expired sessions
> ----------------------------------------------------------------------
>
>                 Key: OWB-351
>                 URL: https://issues.apache.org/jira/browse/OWB-351
>             Project: OpenWebBeans
>          Issue Type: Bug
>          Components: Context and Scopes
>    Affects Versions: M4
>            Reporter: Mark Struberg
>            Assignee: Mark Struberg
>            Priority: Blocker
>             Fix For: 1.0.0
>
>
> We currently store the CreationalContext instance from creating time inside the NormalScopedBeanInterceptorHandler.
> This leads to the fact that we pickup the contextual instance stored in that very CreationalContext even if the context itself is long time gone (e.g. if the session expired. This also leads to the side effect that we currently pickup contextual instances from the wrong session if the proxy gets injected into a wider scoped instance (e.g. an @ApplicationScoped bean).
> Thus, we must drop the CreationalContext from all our NormalScoped proxies and create a new CreationalContext each time we create a new contextual instance.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Resolved: (OWB-351) OWB picks up @SessionScoped contextual instances from expired sessions

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

Mark Struberg resolved OWB-351.
-------------------------------

    Resolution: Fixed

> OWB picks up @SessionScoped contextual instances from expired sessions
> ----------------------------------------------------------------------
>
>                 Key: OWB-351
>                 URL: https://issues.apache.org/jira/browse/OWB-351
>             Project: OpenWebBeans
>          Issue Type: Bug
>          Components: Context and Scopes
>    Affects Versions: M4
>            Reporter: Mark Struberg
>            Assignee: Mark Struberg
>            Priority: Blocker
>             Fix For: 1.0.0
>
>
> We currently store the CreationalContext instance from creating time inside the NormalScopedBeanInterceptorHandler.
> This leads to the fact that we pickup the contextual instance stored in that very CreationalContext even if the context itself is long time gone (e.g. if the session expired. This also leads to the side effect that we currently pickup contextual instances from the wrong session if the proxy gets injected into a wider scoped instance (e.g. an @ApplicationScoped bean).
> Thus, we must drop the CreationalContext from all our NormalScoped proxies and create a new CreationalContext each time we create a new contextual instance.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira