[
https://issues.apache.org/jira/browse/NIFI-322?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Toivo Adams updated NIFI-322:
-----------------------------
Attachment: NIFI-322_08mar2015.patch
I should be more careful, rushed too much.
Attached please find fixes.
But I have one problem with class loaders.
When using URLClassLoader, java JDBC DriverManager is unable to find suitable
driver by database url anymore.
See testURLClassLoader()
// ClassLoaders
ClassLoader parent = Thread.currentThread().getContextClassLoader();
URLClassLoader ucl = new URLClassLoader(urls,parent);
// this will cause driver load and registration in DriverManager
// ucl ClassLoader will be used
Class<?> clazz = Class.forName("org.mariadb.jdbc.Driver", true, ucl);
assertNotNull(clazz);
// But when DriverManager will try to find driver it will use internal method
// which will use caller classloader and this result parent
// Indicates whether the class object that would be created if the code
calling
// DriverManager is accessible.
private static boolean isDriverAllowed(Driver driver, Class<?> caller) {
ClassLoader callerCL = caller != null ? caller.getClassLoader() : null;
return isDriverAllowed(driver, callerCL);
}
Method name isDriverAllowed() is little bit misleading, method is also used to
find suitable driver and problem is not with access rights.
> 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.patch, NIFI-322_03mar2015.patch, NIFI-322_08mar2015.patch,
> TestDatabaseSystems.java, TestProcessor.java
>
>
> Often DataFlows contain many processors which deal with database - select,
> update or delete different data in different tables.
> 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.
> Database Connection Pooling Controller Service helps to solve this in
> consistent way.
> related
> https://issues.apache.org/jira/browse/NIFI-293 : Add a JDBC Processor for
> executing arbitrary SQL queries.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)