New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autowired properties can remain unset during concurrent instantiation of prototype-beans [SPR-9806] #14439

Closed
spring-issuemaster opened this Issue Sep 18, 2012 · 1 comment

Comments

Projects
None yet
2 participants
@spring-issuemaster
Copy link
Collaborator

spring-issuemaster commented Sep 18, 2012

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:

Issue Links:

  • #13901 Threading issue in InjectionMetadata.InjectedElement ("is duplicated by")
  • #14485 @Resource injection of singleton in prototype using AnnotationConfigApplicationContext is not thread-safe

Referenced from: commits b79260a, 7fc1629

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

spring-issuemaster commented Sep 18, 2012

Barnabas Bodnar commented

The attachment concurrent-getbean-with-autowiring.zip contains a minimal environment and code required to reproduce the error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment