Uploaded image for project: 'Weld'
  1. Weld
  2. WELD-1010

@PreDestroy method invoked twice

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 1.1.4.Final
    • 1.1.3.SP1
    • Scopes & Contexts
    • None
    • Hide

      for(Bean b: bm.getBeans(TestBean.class)){
      CreationalContext ctx = bm.createCreationalContext(null);
      TestBean testBean = (TestBean)bm.getReference(b, b.getBeanClass(), ctx);
      b.destroy(testBean, ctx);
      }

      TestBean is simple POJO with @PreDestroy method

      Show
      for(Bean b: bm.getBeans(TestBean.class)){ CreationalContext ctx = bm.createCreationalContext(null); TestBean testBean = (TestBean)bm.getReference(b, b.getBeanClass(), ctx); b.destroy(testBean, ctx); } TestBean is simple POJO with @PreDestroy method

    Description

      @PreDestroy method on @Dependend scope is invoked twice when we use Bean.destroy() method.

      Problem occurs in destroy() method:

      getInjectionTarget().preDestroy(instance);
      creationalContext.release();

      Attachments

        Activity

          People

            ajustin@redhat.com Ales Justin
            wojtek9_jira wojtek k (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: