You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Concurrent retrieval of prototype-scoped beans may result in null @Autowired fields [SPR-9256] #13894
in: coreIssues in core modules (aop, beans, core, context, expression)status: declinedA suggestion or change that we don't feel we should currently apply
I am hesitant to put it here because it is so hard to believe. But basically we have a prototype bean (marked through @Scope annotation) with a
{{
private transient SomeService service;
@Autowired
public void setSomeService() {
...
}
}}
Several of such beans are concurrently retrieved from the application context. And sporadically, but reproducibly (!), for one of them service would be null. I have removed transient modifier and I cannot reproduce it anymore...
It would be interesting to hear Juergen's comment on this. Is this even in the realm of possibility that a transient modifier could matter???
Hmm... I was able to reproduce it without the transient modifier. So, the modifier is not the issue. :-) But it looks like prototype bean retrieval is not fully thread safe...
in: coreIssues in core modules (aop, beans, core, context, expression)status: declinedA suggestion or change that we don't feel we should currently apply
Activity
spring-projects-issues commentedon Mar 21, 2012
Kyrill Alyoshin commented
Hmm... I was able to reproduce it without the transient modifier. So, the modifier is not the issue. :-) But it looks like prototype bean retrieval is not fully thread safe...
spring-projects-issues commentedon Mar 26, 2012
Chris Beams commented
Hi Kyrill,
We'll need a simple reproduction project to diagnose this one. It's understood that the failure to inject is intermittent, but something that reproduces it at least some of the time would really help. See https://github.com/SpringSource/spring-framework-issues#readme. Thanks.
spring-projects-issues commentedon Dec 28, 2018
Sébastien Deleuze commented
Closing groups of outdated issues. Please reopen if still relevant.