Skip to content

dependentBeanMap won't be rebuilt after destroySingleton and recreate it [SPR-16249] #20796

@spring-projects-issues

Description

@spring-projects-issues

Nick Allen opened SPR-16249 and commented

If we call destroySingleton it calls destroyBean which remove it's dependency from dependentBeanMap. Then if we call getBean which create that singleton again, dependency won't be added back to dependentBeanMap (Because it should have been added in AutowiredAnnotationBeanPostProcessor.inject but it won't call registerDependentBeans if it is cached).

Solution: Remove metadataCache of bean in injectionMetadataCache when that bean get destroyed.


Affects: 4.3.10

Issue Links:

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: coreIssues in core modules (aop, beans, core, context, expression)status: supersededAn issue that has been superseded by anothertype: enhancementA general enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions