问题
It's my understanding that in Spring, all objects are treated by default as singletons. If singleton is set to false, then a new object will be served at each request.
But what if I wanted to pool objects? Say set a range from a min of 1 to a max of 10 instances? Is this possible using Spring?
回答1:
Pooling can be applied to any POJO with spring.
See here for more information.
来源:https://stackoverflow.com/questions/893041/how-does-one-manage-object-pooling-in-spring