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

Conditions under which CreationalContextImpl.dependences continues to reference the looked-up Dependent instance

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 5.1.7.Final
    • Proxies
    • None
    • JBoss Enterprise Application Platform

      When an AOP Dependent Bean instance is got using jakarta.enterprise.inject.Instance#get(), why does CreationalContextImpl.dependentInstances continue to reference it?

       

      I created a reproduction program.

      Would you access the following git repository ?

      https://github.com/jjugnsjeecditips202602/febtips04.git

       

      And then , please build the web application and deploy febtips04-0.0.1-SNAPSHOT.war  to JBoss EAP or WildFly.

       

      ```

      mvn clean package

      ```

       

      If you open the following URL in your browser and refresh it 20 times, you should experience an Out of Memory error.

       

      ```
      http://localhost:8080/febtips04-0.0.1-SNAPSHOT/rest4/dpndnt
      ```

       

      Runtime Info:

      • Java SE 17
      • Jakarta EE 10
      • Jakarta CDI 4.0.1
      • JBoss EAP 8.0.x

       

      On the other hand, dependent bean instances that do not have AOP annotations declared are not referenced in CreationalContextImpl.dependences, so there is no need to pass them to CDI.current().destroy().

       

      febtips04/src/main/java/io/github/futokiyo/febtips04/sample/Sample.java at feature/dependent-without-aop · jjugnsjeecditips202602/febtips04

       

      What are the reasons for this difference in behavior between main branch and feature/dependent-without-aop branch?

       

       

       

       

       

              Unassigned Unassigned
              futokiyo FUTOSHI YOSHIZAKI
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: