How does one manage object pooling in Spring?

Cuga picture Cuga · May 21, 2009 · Viewed 14.5k times · Source

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?

Answer

toolkit picture toolkit · May 21, 2009

Pooling can be applied to any POJO with spring.

See here for more information.