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

John D. Ament commented on DELTASPIKE-528:
------------------------------------------

All TCK tests pass, which is a little surprising.  I tested a few different 
versions of weld, all seem ok.  I'm not going to commit yet.

Even if we invalidate the context, application contexts are still available.

One interesting issue,  I made this change at the end of the restart context 
test.  Weld it fails, indicating that it's still the same application context, 
and the beans returned are the same as originally provided:

        CarRepair carRepair2 = (CarRepair)
            beanManager.getReference(bean, CarRepair.class, 
beanManager.createCreationalContext(bean));

        Assert.assertNotNull(carRepair2.getCar());
        Assert.assertNotNull(carRepair2.getCar().getUser());
        Assert.assertNull(carRepair2.getCar().getUser().getName());
        Assert.assertFalse(carRepair == carRepair2);

The last assert is what fails.  It would seem that even invalidating the 
application context does nothing.  So I guess what are you trying to achieve by 
invalidating it?

> stopContexts()  and container shutdown() do not dispose of application scoped 
> beans
> -----------------------------------------------------------------------------------
>
>                 Key: DELTASPIKE-528
>                 URL: https://issues.apache.org/jira/browse/DELTASPIKE-528
>             Project: DeltaSpike
>          Issue Type: Bug
>          Components: CdiControl
>    Affects Versions: 0.5
>         Environment: weld se 1.1.16
>            Reporter: Shay matasaro
>            Assignee: John D. Ament
>
> when using the CdiControl module stopContexts()  and container shutdown() do 
> not dispose of application scoped beans
> dispose methods are not getting called and same goes for preDestroty
> based on a comment from https://issues.jboss.org/browse/WELD-1072
> I added 
>  ApplicationContext context = 
> BeanProvider.getContextualReference(ApplicationContext.class);
> context.invalidate();
> and that seems to do the trick
> I am not sure if this is a weld issue or a DS?
> does it only apply to application scope?
> maybe stopContexts() can iterate over all 4 builtin contexts and specifically 
> invalidate each one if its active?



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to