From 12870f1b9cbeffa08c1091737c075131a1aa5fd6 Mon Sep 17 00:00:00 2001 From: default Date: Thu, 15 Nov 2018 18:55:11 +0800 Subject: [PATCH] update --- nms_sync/bin/db.properties | 4 +++- nms_sync/conf/db.properties | 4 +++- nms_sync/src/com/nms/main/Conn.java | 2 ++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/nms_sync/bin/db.properties b/nms_sync/bin/db.properties index 69071e9..9eb701a 100644 --- a/nms_sync/bin/db.properties +++ b/nms_sync/bin/db.properties @@ -14,4 +14,6 @@ dbMaxActive=2 #\u6700\u5c0f\u8fde\u63a5\u6570 dbMinIdle=1 #\u6700\u5927\u7b49\u5f85\u8fde\u63a5\u65f6\u95f4 -dbMaxWait=60000 \ No newline at end of file +dbMaxWait=60000 +#\u8bbe\u7f6e\u8d85\u8fc7\u65f6\u95f4\u56de\u6536\u8fde\u63a5 +removeAbandonedTimeout=1800 \ No newline at end of file diff --git a/nms_sync/conf/db.properties b/nms_sync/conf/db.properties index 69071e9..9eb701a 100644 --- a/nms_sync/conf/db.properties +++ b/nms_sync/conf/db.properties @@ -14,4 +14,6 @@ dbMaxActive=2 #\u6700\u5c0f\u8fde\u63a5\u6570 dbMinIdle=1 #\u6700\u5927\u7b49\u5f85\u8fde\u63a5\u65f6\u95f4 -dbMaxWait=60000 \ No newline at end of file +dbMaxWait=60000 +#\u8bbe\u7f6e\u8d85\u8fc7\u65f6\u95f4\u56de\u6536\u8fde\u63a5 +removeAbandonedTimeout=1800 \ No newline at end of file diff --git a/nms_sync/src/com/nms/main/Conn.java b/nms_sync/src/com/nms/main/Conn.java index ae9ef6f..e152675 100644 --- a/nms_sync/src/com/nms/main/Conn.java +++ b/nms_sync/src/com/nms/main/Conn.java @@ -30,6 +30,8 @@ public class Conn { druid.setMaxActive(Integer.valueOf(PropKit.get("dbMaxActive"))); druid.setMinIdle(Integer.valueOf(PropKit.get("dbMinIdle"))); druid.setMaxWait(Integer.valueOf(PropKit.get("dbMaxWait"))); + druid.setRemoveAbandoned(true); + druid.setRemoveAbandonedTimeoutMillis(Integer.valueOf(PropKit.get("dbMaxWait"))); ActiveRecordPlugin arp=new ActiveRecordPlugin(url,druid); arp.setShowSql(true); druid.start();