summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nms_sync/bin/db.properties4
-rw-r--r--nms_sync/conf/db.properties4
-rw-r--r--nms_sync/src/com/nms/main/Conn.java2
-rw-r--r--nms_sync/src/com/nms/main/SyncData.java2
4 files changed, 10 insertions, 2 deletions
diff --git a/nms_sync/bin/db.properties b/nms_sync/bin/db.properties
index 69071e9..5d43533 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
+#\u8fde\u63a5\u6c60\u81ea\u52a8\u5173\u95ed\u8fde\u63a5\u65f6\u95f4
+dbRemoveAbandonedTimeout=1800 \ No newline at end of file
diff --git a/nms_sync/conf/db.properties b/nms_sync/conf/db.properties
index 69071e9..5d43533 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
+#\u8fde\u63a5\u6c60\u81ea\u52a8\u5173\u95ed\u8fde\u63a5\u65f6\u95f4
+dbRemoveAbandonedTimeout=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..66bc9f4 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("dbRemoveAbandonedTimeout")));
ActiveRecordPlugin arp=new ActiveRecordPlugin(url,druid);
arp.setShowSql(true);
druid.start();
diff --git a/nms_sync/src/com/nms/main/SyncData.java b/nms_sync/src/com/nms/main/SyncData.java
index a1d76f9..9f6a745 100644
--- a/nms_sync/src/com/nms/main/SyncData.java
+++ b/nms_sync/src/com/nms/main/SyncData.java
@@ -47,6 +47,8 @@ public class SyncData{
masterDruid.setMaxActive(Integer.valueOf(PropKit.get("dbMaxActive")));
masterDruid.setMinIdle(Integer.valueOf(PropKit.get("dbMinIdle")));
masterDruid.setMaxWait(Integer.valueOf(PropKit.get("dbMaxWait")));
+ masterDruid.setRemoveAbandoned(true);
+ masterDruid.setRemoveAbandonedTimeoutMillis(Integer.valueOf(PropKit.get("dbRemoveAbandonedTimeout")));
ActiveRecordPlugin masterArp=new ActiveRecordPlugin("masterDataSource",masterDruid);
masterArp.setShowSql(true);
masterDruid.start();