Closed
Description
Barnabas Bodnar opened SPR-9806 and commented
Autowired properties of prototype-beans referencing singletons can remain unset, if ApplicationContext.getBean(...) is called for the prototype-bean concurrently.
Neither the initialization-type of the singleton, nor the fact, whether the singleton already exists or not, plays a role (i.e. the error occurs even if the singleton is already initialized).
The error is reproducible even with low concurrency-rates (2 threads).
Affects: 3.1.2
Attachments:
- concurrent-getbean-with-autowiring.zip (4.51 kB)
Issue Links:
- Threading issue in InjectionMetadata.InjectedElement [SPR-9263] #13901 Threading issue in InjectionMetadata.InjectedElement ("is duplicated by")
- @Resource injection of singleton in prototype using AnnotationConfigApplicationContext is not thread-safe [SPR-9852] #14485
@Resource
injection of singleton in prototype using AnnotationConfigApplicationContext is not thread-safe