This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
As core container inject the dependency with bean id defined in spring-config.xml. My question can configure the objects here which are
holding some state? I mean two request comes for the same object at same time , will container create the new instances for both of them
if the scope is prototype? Last question is does container maintain some pool for the created objects or they are good for garbage collection
as soon as they are finished?
If you set the scope to "prototype" everytime someone calls getBean() will get a new instance. However, typically, most beans are objects that do not hold state and having a single instance only is plenty to support many clients all at the same time. There would be no thread issues. Spring does not pool objects, there is no need for pools of Spring beans.