commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pste...@apache.org
Subject svn commit: r1693385 - in /commons/proper/dbcp/trunk/src: changes/changes.xml main/java/org/apache/commons/dbcp2/BasicDataSourceFactory.java test/java/org/apache/commons/dbcp2/TestBasicDataSourceFactory.java
Date Thu, 30 Jul 2015 03:59:52 GMT
Author: psteitz
Date: Thu Jul 30 03:59:51 2015
New Revision: 1693385

URL: http://svn.apache.org/r1693385
Log:
Added BasicDataSource abandonedUsageTracking property missing from BasicDataSourceFactory.
JIRA: DBCP-441.

Modified:
    commons/proper/dbcp/trunk/src/changes/changes.xml
    commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/BasicDataSourceFactory.java
    commons/proper/dbcp/trunk/src/test/java/org/apache/commons/dbcp2/TestBasicDataSourceFactory.java

Modified: commons/proper/dbcp/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/changes/changes.xml?rev=1693385&r1=1693384&r2=1693385&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/changes/changes.xml (original)
+++ commons/proper/dbcp/trunk/src/changes/changes.xml Thu Jul 30 03:59:51 2015
@@ -61,6 +61,9 @@ The <action> type attribute can be add,u
 
   <body>
     <release version="2.1.1" date="TBD" description="Bug fixes.">
+      <action issue="DBCP-441" dev="psteitz" type="fix">
+        Added BasicDataSource abandonedUsageTracking property missing from BasicDataSourceFactory.
+      </action>
       <action issue="DBCP-442" dev="psteitz" type="fix">
         SharedPoolDataSource getConnection fails when testOnBorrow is set with
         a null validation query.

Modified: commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/BasicDataSourceFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/BasicDataSourceFactory.java?rev=1693385&r1=1693384&r2=1693385&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/BasicDataSourceFactory.java
(original)
+++ commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/BasicDataSourceFactory.java
Thu Jul 30 03:59:51 2015
@@ -101,6 +101,7 @@ public class BasicDataSourceFactory impl
     private static final String PROP_REMOVEABANDONEDONMAINTENANCE = "removeAbandonedOnMaintenance";
     private static final String PROP_REMOVEABANDONEDTIMEOUT = "removeAbandonedTimeout";
     private static final String PROP_LOGABANDONED = "logAbandoned";
+    private static final String PROP_ABANDONEDUSAGETRACKING = "abandonedUsageTracking";
     private static final String PROP_POOLPREPAREDSTATEMENTS = "poolPreparedStatements";
     private static final String PROP_MAXOPENPREPAREDSTATEMENTS = "maxOpenPreparedStatements";
     private static final String PROP_CONNECTIONPROPERTIES = "connectionProperties";
@@ -167,6 +168,7 @@ public class BasicDataSourceFactory impl
         PROP_REMOVEABANDONEDONMAINTENANCE,
         PROP_REMOVEABANDONEDTIMEOUT,
         PROP_LOGABANDONED,
+        PROP_ABANDONEDUSAGETRACKING,
         PROP_POOLPREPAREDSTATEMENTS,
         PROP_MAXOPENPREPAREDSTATEMENTS,
         PROP_CONNECTIONPROPERTIES,
@@ -516,6 +518,11 @@ public class BasicDataSourceFactory impl
         if (value != null) {
             dataSource.setLogAbandoned(Boolean.valueOf(value).booleanValue());
         }
+        
+        value = properties.getProperty(PROP_ABANDONEDUSAGETRACKING);
+        if (value != null) {
+            dataSource.setAbandonedUsageTracking(Boolean.valueOf(value).booleanValue());
+        }
 
         value = properties.getProperty(PROP_POOLPREPAREDSTATEMENTS);
         if (value != null) {

Modified: commons/proper/dbcp/trunk/src/test/java/org/apache/commons/dbcp2/TestBasicDataSourceFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/java/org/apache/commons/dbcp2/TestBasicDataSourceFactory.java?rev=1693385&r1=1693384&r2=1693385&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/test/java/org/apache/commons/dbcp2/TestBasicDataSourceFactory.java
(original)
+++ commons/proper/dbcp/trunk/src/test/java/org/apache/commons/dbcp2/TestBasicDataSourceFactory.java
Thu Jul 30 03:59:51 2015
@@ -75,6 +75,7 @@ public class TestBasicDataSourceFactory
         properties.setProperty("removeAbandoned", "true");
         properties.setProperty("removeAbandonedTimeout", "3000");
         properties.setProperty("logAbandoned", "true");
+        properties.setProperty("abandonedUsageTracking", "true");
         properties.setProperty("poolPreparedStatements", "true");
         properties.setProperty("maxOpenPreparedStatements", "10");
         properties.setProperty("lifo", "true");
@@ -114,6 +115,7 @@ public class TestBasicDataSourceFactory
         assertEquals(false, ds.getRemoveAbandonedOnMaintenance());
         assertEquals(3000, ds.getRemoveAbandonedTimeout());
         assertEquals(true, ds.getLogAbandoned());
+        assertEquals(true, ds.getAbandonedUsageTracking());
         assertEquals(true, ds.isPoolPreparedStatements());
         assertEquals(10, ds.getMaxOpenPreparedStatements());
         assertEquals(true, ds.getLifo());



Mime
View raw message