You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by mt...@apache.org on 2018/09/20 12:19:40 UTC

nifi git commit: NIFI-5614: Update commons-dbcp to commons-dbcp2 for DBCPConnectionPool

Repository: nifi
Updated Branches:
  refs/heads/master 73a7c8c6b -> 2ee0af966


NIFI-5614: Update commons-dbcp to commons-dbcp2 for DBCPConnectionPool

This closes #3014

Signed-off-by: Mike Thomsen <mi...@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/2ee0af96
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/2ee0af96
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/2ee0af96

Branch: refs/heads/master
Commit: 2ee0af9663d56b5c0d709d77c83cda4ba2f75ade
Parents: 73a7c8c
Author: Matthew Burgess <ma...@apache.org>
Authored: Wed Sep 19 19:34:17 2018 -0400
Committer: Mike Thomsen <mi...@gmail.com>
Committed: Thu Sep 20 08:17:52 2018 -0400

----------------------------------------------------------------------
 .../src/main/resources/META-INF/NOTICE                    | 10 ++++++++--
 .../nifi-dbcp-service-bundle/nifi-dbcp-service/pom.xml    |  6 +++---
 .../java/org/apache/nifi/dbcp/DBCPConnectionPool.java     |  6 +++---
 .../test/java/org/apache/nifi/dbcp/DBCPServiceTest.java   |  4 ----
 4 files changed, 14 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/nifi/blob/2ee0af96/nifi-nar-bundles/nifi-standard-services/nifi-dbcp-service-bundle/nifi-dbcp-service-nar/src/main/resources/META-INF/NOTICE
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-services/nifi-dbcp-service-bundle/nifi-dbcp-service-nar/src/main/resources/META-INF/NOTICE b/nifi-nar-bundles/nifi-standard-services/nifi-dbcp-service-bundle/nifi-dbcp-service-nar/src/main/resources/META-INF/NOTICE
index 3f9df0d..f2635b6 100644
--- a/nifi-nar-bundles/nifi-standard-services/nifi-dbcp-service-bundle/nifi-dbcp-service-nar/src/main/resources/META-INF/NOTICE
+++ b/nifi-nar-bundles/nifi-standard-services/nifi-dbcp-service-bundle/nifi-dbcp-service-nar/src/main/resources/META-INF/NOTICE
@@ -21,12 +21,18 @@ The following binary components are provided under the Apache Software License v
   (ASLv2) Apache Commons DBCP
     The following NOTICE information applies:
       Apache Commons DBCP
-      Copyright 2001-2015 The Apache Software Foundation.
+      Copyright 2001-2018 The Apache Software Foundation
+
+      This product includes software developed at
+      The Apache Software Foundation (http://www.apache.org/).
       
   (ASLv2) Apache Commons Pool
     The following NOTICE information applies:
       Apache Commons Pool
-      Copyright 1999-2009 The Apache Software Foundation.
+      Copyright 2001-2018 The Apache Software Foundation
+
+      This product includes software developed at
+      The Apache Software Foundation (http://www.apache.org/).
 
   (ASLv2) Apache Derby
     The following NOTICE information applies:

http://git-wip-us.apache.org/repos/asf/nifi/blob/2ee0af96/nifi-nar-bundles/nifi-standard-services/nifi-dbcp-service-bundle/nifi-dbcp-service/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-services/nifi-dbcp-service-bundle/nifi-dbcp-service/pom.xml b/nifi-nar-bundles/nifi-standard-services/nifi-dbcp-service-bundle/nifi-dbcp-service/pom.xml
index 6cde4d6..11c0846 100644
--- a/nifi-nar-bundles/nifi-standard-services/nifi-dbcp-service-bundle/nifi-dbcp-service/pom.xml
+++ b/nifi-nar-bundles/nifi-standard-services/nifi-dbcp-service-bundle/nifi-dbcp-service/pom.xml
@@ -49,9 +49,9 @@
             <scope>test</scope>
         </dependency>
         <dependency>
-            <groupId>commons-dbcp</groupId>
-            <artifactId>commons-dbcp</artifactId>
-            <version>1.4</version>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-dbcp2</artifactId>
+            <version>2.5.0</version>
         </dependency>
         <dependency>
             <groupId>org.apache.derby</groupId>

http://git-wip-us.apache.org/repos/asf/nifi/blob/2ee0af96/nifi-nar-bundles/nifi-standard-services/nifi-dbcp-service-bundle/nifi-dbcp-service/src/main/java/org/apache/nifi/dbcp/DBCPConnectionPool.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-services/nifi-dbcp-service-bundle/nifi-dbcp-service/src/main/java/org/apache/nifi/dbcp/DBCPConnectionPool.java b/nifi-nar-bundles/nifi-standard-services/nifi-dbcp-service-bundle/nifi-dbcp-service/src/main/java/org/apache/nifi/dbcp/DBCPConnectionPool.java
index 8d59c1c..eaead48 100644
--- a/nifi-nar-bundles/nifi-standard-services/nifi-dbcp-service-bundle/nifi-dbcp-service/src/main/java/org/apache/nifi/dbcp/DBCPConnectionPool.java
+++ b/nifi-nar-bundles/nifi-standard-services/nifi-dbcp-service-bundle/nifi-dbcp-service/src/main/java/org/apache/nifi/dbcp/DBCPConnectionPool.java
@@ -16,7 +16,7 @@
  */
 package org.apache.nifi.dbcp;
 
-import org.apache.commons.dbcp.BasicDataSource;
+import org.apache.commons.dbcp2.BasicDataSource;
 import org.apache.nifi.annotation.behavior.DynamicProperty;
 import org.apache.nifi.annotation.documentation.CapabilityDescription;
 import org.apache.nifi.annotation.documentation.Tags;
@@ -200,8 +200,8 @@ public class DBCPConnectionPool extends AbstractControllerService implements DBC
 
         final String dburl = context.getProperty(DATABASE_URL).evaluateAttributeExpressions().getValue();
 
-        dataSource.setMaxWait(maxWaitMillis);
-        dataSource.setMaxActive(maxTotal);
+        dataSource.setMaxWaitMillis(maxWaitMillis);
+        dataSource.setMaxTotal(maxTotal);
 
         if (validationQuery!=null && !validationQuery.isEmpty()) {
             dataSource.setValidationQuery(validationQuery);

http://git-wip-us.apache.org/repos/asf/nifi/blob/2ee0af96/nifi-nar-bundles/nifi-standard-services/nifi-dbcp-service-bundle/nifi-dbcp-service/src/test/java/org/apache/nifi/dbcp/DBCPServiceTest.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-services/nifi-dbcp-service-bundle/nifi-dbcp-service/src/test/java/org/apache/nifi/dbcp/DBCPServiceTest.java b/nifi-nar-bundles/nifi-standard-services/nifi-dbcp-service-bundle/nifi-dbcp-service/src/test/java/org/apache/nifi/dbcp/DBCPServiceTest.java
index a07f064..21f699b 100644
--- a/nifi-nar-bundles/nifi-standard-services/nifi-dbcp-service-bundle/nifi-dbcp-service/src/test/java/org/apache/nifi/dbcp/DBCPServiceTest.java
+++ b/nifi-nar-bundles/nifi-standard-services/nifi-dbcp-service-bundle/nifi-dbcp-service/src/test/java/org/apache/nifi/dbcp/DBCPServiceTest.java
@@ -21,7 +21,6 @@ import org.apache.nifi.processor.exception.ProcessException;
 import org.apache.nifi.reporting.InitializationException;
 import org.apache.nifi.util.TestRunner;
 import org.apache.nifi.util.TestRunners;
-import org.h2.jdbc.JdbcSQLException;
 import org.h2.tools.Server;
 import org.junit.Assert;
 import org.junit.BeforeClass;
@@ -209,9 +208,6 @@ public class DBCPServiceTest {
         server.shutdown();
         server.start();
 
-        // Note!! We should get something like:
-        // org.h2.jdbc.JdbcSQLException: Connection is broken: "session closed" [90067-192]
-        exception.expect(JdbcSQLException.class);
         for (int i = 0; i < 10; i++) {
             final Connection connection = dbcpService.getConnection();
             System.out.println(connection);