How does one manage object pooling in Spring?

[亡魂溺海] 提交于 2019-12-20 10:17:10

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!