[
https://issues.apache.org/jira/browse/NIFI-5790?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16675614#comment-16675614
]
Colin Dean commented on NIFI-5790:
----------------------------------
I've got code worked up that adds six options:
{code:java}
dataSource.setMinIdle(minIdle);
dataSource.setMaxIdle(maxIdle);
dataSource.setMaxConnLifetimeMillis(maxConnLifetimeMillis);
dataSource.setTimeBetweenEvictionRunsMillis(timeBetweenEvictionRunsMillis);
dataSource.setMinEvictableIdleTimeMillis(minEvictableIdleTimeMillis);
dataSource.setSoftMinEvictableIdleTimeMillis(softMinEvictableIdleTimeMillis);
{code}
I'm using the defaults plucked from the [commons-dbcp
docs|https://commons.apache.org/proper/commons-dbcp/configuration.html] and
made only slight modifications to the help text for each so that the text makes
more sense in the context of NiFi.
I'm awaiting a test and package build before I test it.
I don't know how best to write tests for this functionality, though. The test
in {{org.apache.nifi.dbcp.DBCPServiceTest#testMaxWait}} seems to set a
non-default option and expect the controller service to be valid. I suppose I
could do that ~generatively in order to capture a breadth of all six options'
configurability…
> DBCPConnectionPool configuration should expose underlying connection idle and
> eviction configuration
> ----------------------------------------------------------------------------------------------------
>
> Key: NIFI-5790
> URL: https://issues.apache.org/jira/browse/NIFI-5790
> Project: Apache NiFi
> Issue Type: Improvement
> Components: Extensions
> Affects Versions: 1.8.0
> Reporter: Colin Dean
> Priority: Major
> Labels: DBCP, database
>
> While investigating a fix for NIFI-5789, I noticed in the [DBCPConnectionPool
> documentation|https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-dbcp-service-nar/1.8.0/org.apache.nifi.dbcp.DBCPConnectionPool/index.html]
> that NiFi appears _not_ to have controller service configuration options
> associated with [Apache
> Commons-DBCP|https://commons.apache.org/proper/commons-dbcp/configuration.html]
> {{BasicDataSource}} parameters like {{minIdle}} and {{maxIdle}}, which I
> think should be both set to 0 in my particular use case.
> Alternatively, I think I could set {{maxConnLifetimeMillis}} to something
> even in the minutes range and satisfy my use case (a connection need not be
> released _immediately_ but within a reasonable period of time), but this
> option is also not available.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)