TOMCAT防止連接池泄漏

 這在JNDI的文檔中是有敘述的:
http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html

 

大體上說的就是在server.xml中的<ResourceParams>
中加入如下參數:
 
<!– To configure a DBCP DataSource so that abandoned dB connections are removed and recycled add the following paramater to the ResourceParams configuration for your DBCP DataSource Resource: –>
 
<parameter>
<name>removeAbandoned</name>
<value>true</value>
</parameter>
 
<!–Use the removeAbandonedTimeout parameter to set the number of
seconds a dB connection has been idle before it is considered abandoned. –>
 
<parameter>
<name>removeAbandonedTimeout</name>
<value>60</value>
</parameter>
發佈了22 篇原創文章 · 獲贊 8 · 訪問量 7萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章