Return-Path: X-Original-To: apmail-nifi-commits-archive@minotaur.apache.org Delivered-To: apmail-nifi-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 07DF910968 for ; Sat, 28 Mar 2015 17:53:18 +0000 (UTC) Received: (qmail 5252 invoked by uid 500); 28 Mar 2015 17:53:18 -0000 Delivered-To: apmail-nifi-commits-archive@nifi.apache.org Received: (qmail 5211 invoked by uid 500); 28 Mar 2015 17:53:17 -0000 Mailing-List: contact commits-help@nifi.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@nifi.incubator.apache.org Delivered-To: mailing list commits@nifi.incubator.apache.org Received: (qmail 5201 invoked by uid 99); 28 Mar 2015 17:53:17 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 28 Mar 2015 17:53:17 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO mail.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with SMTP; Sat, 28 Mar 2015 17:52:56 +0000 Received: (qmail 5129 invoked by uid 99); 28 Mar 2015 17:52:53 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 28 Mar 2015 17:52:53 +0000 Date: Sat, 28 Mar 2015 17:52:53 +0000 (UTC) From: "Toivo Adams (JIRA)" To: commits@nifi.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (NIFI-322) New Database Connection Pooling Controller Service MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/NIFI-322?page=3Dcom.atlassian.= jira.plugin.system.issuetabpanels:all-tabpanel ] Toivo Adams updated NIFI-322: ----------------------------- Attachment: NIFI-322_28mar2015.patch Thanks for help and patience. Attached please find new patch. 1. It's little bit unusual but return to pool is here, no extra code is nee= ded. When asking connection, pool return wrapper which contain actual conne= ction. And calling connection.close() will return connection to pool, not c= losing it actually. Please see testExhaustPool() and testGetManyNormal(). This gives ability to to old code which just take connection as input param= eter and dont know nothing about connection pool. Code just need to call us= ual connection.close() 2. testExternalJDBCDriverUsage() and testURLClassLoaderGetConnection() are = marked with @Ignore Maybe patch was still incorrect or you mean something more? 3. Right, "Database Type" is much better. Vendor is also good name, but for= example Derby has 2 versions, embedded and server, so vendor is not enough= . 4. Removed default port. 5. JDBC vendors world is not straightforward. Often not only database vendo= rs offer JDBC drivers but other companies may also offer perfectly well wor= king drivers with different driver names. And even the same database vendor may offer different drivers with differen= t names. For example Sybase offer jConnect 6.0 and jConnect 7.0 and driver names are= correspondingly com.sybase.jdbc3.jdbc.SybDriver and com.sybase.jdbc4.jdbc.= SybDriver My idea was to provide default driver name which user can change. Currently DatabaseSystems contain only few database types, in future this l= ist should expanded to help user. 6. My idea was to help user and describe some known database types. So Data= baseSystems contain description like "MariaDB is a community-developed fork= of the MySQL relational database management system intended to remain free= under the GNU GPL." and default driver name. But no actual driver is inclu= ded in NiFi distribution. There is also section header in code =E2=80=9CJDBC driver jar must be loade= d from external location=E2=80=9D I hope this is acceptable? I added also comments to DatabaseSystems code, just to be sure. 7. I created /nifi-dbcp-service-bundle/nifi-dbcp-service-nar/src/main/resources/META-INF= /NOTICE =09Not sure it's correct. 8. Max Total Connections =E2=80=93 fixed. 9. Added nifi-dbcp-service dependency to dependencyManagement. Added nifi-dbcp-service-nar dependency to nifi-assembly/pom.xml dependencie= s. Maven started complaining=20 Project build error: 'dependencies.dependency.version' for org.apache.nifi:= nifi-dbcp-service-nar:nar is missing.=09pom.xml=09/nifi-assembly=09line 169= =09 So I added version also. Added nifi-dbcp-service-bundle to nifi-standard-services/pom.xml=20 Thanks Toivo > New Database Connection Pooling Controller Service > -------------------------------------------------- > > Key: NIFI-322 > URL: https://issues.apache.org/jira/browse/NIFI-322 > Project: Apache NiFi > Issue Type: New Feature > Components: Extensions > Reporter: Toivo Adams > Assignee: Mark Payne > Priority: Minor > Labels: controller > Attachments: DBCPServiceApacheDBCP14.java, DBCPServiceTest.java, = DatabaseSystemDescriptor.java, DatabaseSystems.java, NIFI-322_01mar2015.pat= ch, NIFI-322_03mar2015.patch, NIFI-322_08mar2015.patch, NIFI-322_14mar2015.= patch, NIFI-322_22mar2015.patch, NIFI-322_24mar2015.patch, NIFI-322_26mar20= 15.patch, NIFI-322_28mar2015.patch, TestDatabaseSystems.java, TestProcessor= .java > > > Often DataFlows contain many processors which deal with database - select= , update or delete different data in different tables.=20 > Yet database is same and connection pooling helps to speed up connecting = to database (open connection is fairly expensive). Also configuration must = be done only in one place.=20 > Database Connection Pooling Controller Service helps to solve this in con= sistent way.=20 > related > https://issues.apache.org/jira/browse/NIFI-293 : Add a JDBC Processor for= executing arbitrary SQL queries.=20 -- This message was sent by Atlassian JIRA (v6.3.4#6332)