多くのリクエストがあり、最大プール サイズに達すると、リソースが解放されるまで他のリクエストが待機することに気付きました。CommonsPoolTargetSource
最大プール サイズに達したときに新しいオブジェクト インスタンスが作成されるように設定するにはどうすればよいですか? 余分なリソースも、使用後に解放する必要があります。
最初、物件を探してみましたが、物件がないminSize
ことがわかりました。以下は私のweb.xmlの本体です:CommonsPoolTargetSource
minSize
<bean id="simpleBeanTarget" class="com.bean.SimpleBean" scope="prototype">
</bean>
<bean id="poolTargetSource" class="org.springframework.aop.target.CommonsPoolTargetSource">
<property name="targetBeanName" value="simpleBeanTarget" />
<property name="maxSize" value="3" />
<!-- How do I let the pool grow if more than 3 instances is needed? -->
<!-- And how do I release the excess instances after usage? -->
</bean>
<bean id="simpleBean" class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="targetSource" ref="poolTargetSource" />
</bean>