Skip to content
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

Spring 2.5 bean factory is not thread-safe for lazy-init singletons [SPR-4672] #9349

spring-projects-issues opened this issue Apr 7, 2008 · 1 comment


Copy link

@spring-projects-issues spring-projects-issues commented Apr 7, 2008

Pavitar Singh opened SPR-4672 and commented

When i have beans with lazy-init configuration, and those beans i use in DefaultMessageContainer then i was getting Beans not copletely initialized.This was happening under heavy load only, so a case of typical Concurrency issues. I tried to analyze the problem and i have created a blog enrty for my analysis:

Affects: 2.5.1

Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Apr 16, 2008

Juergen Hoeller commented

Thanks for raising this - there was indeed a problem slipping into Spring 2.5 there, caused by a refactoring that we did for concurrency performance reasons. I've revised this for Spring 2.5.4, separating early singleton objects from proper singleton objects in terms of separate Maps. Simply synchronizing on the singleton Map, as before, is not an option since we need to allow for highly concurrent access to already registered singleton objects. The separation of proper singleton objects from early singleton objects into distinct Maps should solve the issue as well while preserving highly performant singleton access.

This will be available in the next 2.5.4 snapshot ( Please give it a try and let me know whether it works for you (again)...


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants