-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Description
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