I have a lot of independent spring beans in my project (classes annotated with @Component
-- NOT lazily initialized). I wanted to know weather the beans will be initialized serially or parallely?
I am asking this because the beans modify a common data structure on initialization and I wanted to know weather the data structure should be made thread-safe.
Spring version used:- 4.2
I was reading open issues on spring jira website:-
According to https://jira.spring.io/browse/SPR-9887 it seems to be parallely initialized
But according to https://jira.spring.io/browse/SPR-8767 it seems to be serially initialized.
Spring initialises beans in serial. There is nothing that says that they are initialised in parallel. In fact, the ticket that you cite (https://jira.spring.io/browse/SPR-9887) is a closed ticket because it's a duplicate of https://jira.spring.io/browse/SPR-8767. This ticket is unresolved and targetted for the release of spring 5.0 in the future, so nothing says that beans are initialised in parallel!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With