Skip to content

Doc: Be more specific regarding circular dependencies in chapter 3 [SPR-525] #5254

@spring-projects-issues

Description

@spring-projects-issues

Torsten Juergeleit opened SPR-525 and commented

Regarding circular dependencies chapter 3 only states the following:

"... You can generally trust Spring to do the right thing. It will pick up configuration issues, including references to non-existent beans and circular dependencies, at BeanFactory load-time. ..."

Reading through the code, e.g. AbstractAutowireCapableBeanFactory.createBean()

"...
// Eagerly cache singletons to be able to resolve circular references
// even when triggered by lifecycle interfaces like BeanFactoryAware.
if (allowEagerCaching && mergedBeanDefinition.isSingleton()) {
addSingleton(beanName, bean);
eagerlyCached = true;
}
..."

or the forum, e.g. http://forum.springframework.org/viewtopic.php?t=1481
gives some hints.

Please add some lines how Spring handles / detects circular dependencies. Additionally some sugestions on how to omit / workaround circular dependencies à la Andreas' sugesstion in http://forum.springframework.org/viewtopic.php?t=1481 would be great.


Affects: 1.1.2

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions