How does one manage object pooling in Spring?

2020-05-19 07:29发布

问题:

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.