Description
Antranig Basman opened SPR-2048 and commented
Personally I consider the change in defaults to allow circular bean references by default (somewhere around Spring 1.2.2 I believe) was a bad mistake - now the central contract of Spring, that a bean is "fully constructed" before it is delivered as a dependency is broken. As well as being conceptually incoherent, this has practical consequences - for example on a project I am working with, around a week of deployers' time has been taken up chasing a "phantom" problem actually caused by a race condition resulting from Spring's order of instantiation of singletons that were participating in a circular reference in a 3rd-party library. I think for "inexperienced" developers to get circular references silently supported by default is a recipe for trouble.
However, the decision was taken too long ago to do much about, but it would be great if in the meantime it were made a good deal easier for the "casual" user of Spring to re-enable the old behaviour of forbidding circular references - the flag Juergen refers to in #6186 is too low-level and can't be easily handed out as a "standard practice" to our team.
Affects: 2.0 M4
Issue Links:
- Make it easier to disallow bean definition overriding [SPR-3734] #8415 Make it easier to disallow bean definition overriding
1 votes, 1 watchers