Skip to content

Concurrent retrieval of prototype-scoped beans may result in null @Autowired fields [SPR-9256] #13894

@spring-projects-issues

Description

@spring-projects-issues

Kyrill Alyoshin opened SPR-9256 and commented

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???


Affects: 3.1 GA

Issue Links:

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: coreIssues in core modules (aop, beans, core, context, expression)status: declinedA suggestion or change that we don't feel we should currently apply

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions