https://blog.csdn.net/weixin_34367257/article/details/91747865
一:場景
tomcat數據源連接oracle數據庫,不斷出現連接數爆滿,導致數據庫掛掉
二:解決辦法
參考文章 http://www.tuicool.com/articles/AbUNj27
也就是在tomcat context.xml配置文件中,添加三個屬性
maxWait="2000" //單位毫秒
removeAbandoned="true"
removeAbandonedTimeout="180" //單位秒
即增加連接池回收機制,活動連接,在超過時間內,沒有使用,會被自動回收
轉載於:https://my.oschina.net/baishi/blog/790138