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

This closes #3014

Signed-off-by: Mike Thomsen <mikerthomsen@gmail.com>
This commit is contained in:
Matthew Burgess 2018-09-19 19:34:17 -04:00 committed by Mike Thomsen
parent 73a7c8c6b4
commit 2ee0af9663
4 changed files with 14 additions and 12 deletions

View File

@ -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:

View File

@ -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>

View File

@ -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);

View File

@ -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);