So my question is regarding singleton scope in spring boot. I have worked on few spring boot projects but I have never seen class annotated with Prototype scope so I am assuming all the beans which are defined are singleton by default in spring boot. Now suppose 2 threads are accessing the bean which is singleton then in that case how can we make sure that changes made by one thread do not affect the other thread working on the same bean.
Now you may say that we can do the synchronization but I have not seen in web applications where synchronization is used to avoid this condition. So how exactly this is handled by spring boot.
request. - Branislav Lazic