<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question dbcpconnection pool drops connection. in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/dbcpconnection-pool-drops-connection/m-p/213357#M69665</link>
    <description>&lt;P&gt;Our flow files ends with putsql's to oracle database. At random times, the flow stops with files in the queue before the putsql's. (5 minute activity shows 0). Stopping and starting nifi does not do anything.&lt;/P&gt;&lt;P&gt;However we found that disabling  and enabling the dbcpconnection pool starts it going again. &lt;/P&gt;&lt;P&gt;We are on nifi.1.2.0&lt;/P&gt;</description>
    <pubDate>Fri, 16 Sep 2022 12:24:15 GMT</pubDate>
    <dc:creator>jonathan_bell</dc:creator>
    <dc:date>2022-09-16T12:24:15Z</dc:date>
    <item>
      <title>dbcpconnection pool drops connection.</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/dbcpconnection-pool-drops-connection/m-p/213357#M69665</link>
      <description>&lt;P&gt;Our flow files ends with putsql's to oracle database. At random times, the flow stops with files in the queue before the putsql's. (5 minute activity shows 0). Stopping and starting nifi does not do anything.&lt;/P&gt;&lt;P&gt;However we found that disabling  and enabling the dbcpconnection pool starts it going again. &lt;/P&gt;&lt;P&gt;We are on nifi.1.2.0&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 12:24:15 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/dbcpconnection-pool-drops-connection/m-p/213357#M69665</guid>
      <dc:creator>jonathan_bell</dc:creator>
      <dc:date>2022-09-16T12:24:15Z</dc:date>
    </item>
    <item>
      <title>Re: dbcpconnection pool drops connection.</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/dbcpconnection-pool-drops-connection/m-p/213358#M69666</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/44442/jonathanbell.html" nodeid="44442" target="_blank"&gt;@Jonathan Bell&lt;/A&gt; Can you add &lt;STRONG&gt;validation query&lt;/STRONG&gt; in connection pool as this &lt;STRONG&gt;Validation query used to validate connections before returning them. When connection is invalid, it get's dropped and new valid connection will be returned. Note!! Using validation might have some performance penalty.&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Query:-&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;select CURRENT_TIMESTAMP&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;Connection pool Configs:-&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="40855-connectionpool.png" style="width: 709px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/16501i798E5CAD42C10B7F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="40855-connectionpool.png" alt="40855-connectionpool.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;and this &lt;STRONG&gt;validation query&lt;/STRONG&gt; will &lt;STRONG&gt;take care of invalid connections&lt;/STRONG&gt;  and drops invalid connections and re enables connections, it helps you to &lt;STRONG&gt;disable and re enable&lt;/STRONG&gt; connection pools.&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 03:39:43 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/dbcpconnection-pool-drops-connection/m-p/213358#M69666</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2019-08-18T03:39:43Z</dc:date>
    </item>
    <item>
      <title>Re: dbcpconnection pool drops connection.</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/dbcpconnection-pool-drops-connection/m-p/213359#M69667</link>
      <description>&lt;P&gt;thanks, I will give it a try.&lt;/P&gt;</description>
      <pubDate>Sun, 15 Oct 2017 21:29:09 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/dbcpconnection-pool-drops-connection/m-p/213359#M69667</guid>
      <dc:creator>jonathan_bell</dc:creator>
      <dc:date>2017-10-15T21:29:09Z</dc:date>
    </item>
    <item>
      <title>Re: dbcpconnection pool drops connection.</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/dbcpconnection-pool-drops-connection/m-p/213360#M69668</link>
      <description>&lt;P&gt;Unfortunately, the validation query doesn't appear to be working. We are still gettng the same issue, the putsql's lose the connection to oracle(looking in oracle it doesn't show any connections), but the controller in nifi, is showing connected, so the putsql's just stop.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Dec 2017 13:14:11 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/dbcpconnection-pool-drops-connection/m-p/213360#M69668</guid>
      <dc:creator>jonathan_bell</dc:creator>
      <dc:date>2017-12-16T13:14:11Z</dc:date>
    </item>
    <item>
      <title>Re: dbcpconnection pool drops connection.</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/dbcpconnection-pool-drops-connection/m-p/213361#M69669</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/44442/jonathanbell.html" nodeid="44442" target="_blank"&gt;@Jonathan Bell&lt;/A&gt;&lt;/P&gt;&lt;P&gt;We also faced these &lt;STRONG&gt;dropping
connection issues&lt;/STRONG&gt; but once we &lt;STRONG&gt;added
validation query to the connection pool the issue got resolved&lt;/STRONG&gt; but we
haven't tried with oracle, Open a jira about lose of connection to oracle.&lt;/P&gt;&lt;P&gt;As a workaround to fix this issue you need to use &lt;STRONG&gt;Rest Api commands to disabling the
controller service and to stop refererring put sql processor after that process
got completed then again Enable DBCP Connection pool and start referring PutSQL
processor will help.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I tried with the below example&lt;/P&gt;&lt;P&gt;I am having a &lt;STRONG&gt;DBCPConnection
pool&lt;/STRONG&gt; which is referring to put sql processor, so when you are trying to
push records to oracle &lt;/P&gt;&lt;P&gt;Schedule another script which is going to&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;1.Stop the PutSQL processor&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Rest Api&lt;/STRONG&gt; Command
to &lt;STRONG&gt;Stop the PutSQL&lt;/STRONG&gt; processor as
Follows&lt;/P&gt;&lt;PRE&gt;curl -i -X PUT -H 'Content-Type:application/json' -d
'{"component": {"state":
"STOPPED","id":
"61fe0748-0160-1000-3bda-82285b30a012"},"revision":
{"version": 1,"clientId":"6082f82f-0160-1000-c7de-88e9e0df0382"}}'
&lt;A href="http://localhost:8080/nifi-api/processors/61fe0748-0160-1000-3bda-82285b30a012" target="_blank" rel="nofollow noopener noreferrer"&gt;http://localhost:8080/nifi-api/processors/61fe0748-0160-1000-3bda-82285b30a012&lt;/A&gt;&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;Explanation:-&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;We need to use &lt;STRONG&gt;PUT&lt;/STRONG&gt;
http method in curl and my &lt;STRONG&gt;PutSQL
Processor id is 61fe0748-0160-1000-3bda-82285b30a012&lt;/STRONG&gt; and i need to stop the
processor so i used &lt;STRONG&gt;STOPPED&lt;/STRONG&gt; as the
state, if you want to start the processor then you need to use RUNNING as state.&lt;/P&gt;&lt;P&gt;To find out &lt;STRONG&gt;client id and version number&lt;/STRONG&gt; use Developer tools
(chrome, firefox etc) and perform any action (start, stop ...etc) in the NiFi
UI and look at the calls made for the processor id.&lt;/P&gt;&lt;P&gt;for reference take a look in the below screenshot&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="44450-restapi.png" style="width: 3834px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/16500iE3692B9EB504FF92/image-size/medium?v=v2&amp;amp;px=400" role="button" title="44450-restapi.png" alt="44450-restapi.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;1.Click on Network &lt;/P&gt;&lt;P&gt;2.In filter keep your processor id&lt;/P&gt;&lt;P&gt;3.Click on Response then you can find clientid,version&lt;/P&gt;&lt;P&gt;Once you get all the values prepare your curl command to
stop PutSQL processor.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;2.Start PutSQL
processor&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Just change the state as &lt;STRONG&gt;RUNNING&lt;/STRONG&gt; then processor will change from Stopped state to running
state.&lt;/P&gt;&lt;PRE&gt;curl -i -X PUT -H 'Content-Type:application/json' -d
'{"component": {"state":
"RUNNING","id":
"61fe0748-0160-1000-3bda-82285b30a012"},"revision":
{"version": 1,"clientId":"6082f82f-0160-1000-c7de-88e9e0df0382"}}'
&lt;A href="http://localhost:8080/nifi-api/processors/61fe0748-0160-1000-3bda-82285b30a012" target="_blank" rel="nofollow noopener noreferrer"&gt;http://localhost:8080/nifi-api/processors/61fe0748-0160-1000-3bda-82285b30a012&lt;/A&gt;&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;3.Stop
DBCPConnection Pool Controller service&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;To Disable connection pool we need to change the state
element value to DISABLED&lt;/P&gt;&lt;PRE&gt;curl -i -X PUT -H 'Content-Type:application/json' -d
'{"revision":{"clientId":"6082f82f-0160-1000-c7de-88e9e0df0382","version":1},"component":{"id":"61fc97d3-0160-1000-49e3-46201fe71092","state":"DISABLED"}}'
&lt;A href="http://localhost:8080/nifi-api/controller-services/61fc97d3-0160-1000-49e3-46201fe71092" target="_blank" rel="nofollow noopener noreferrer"&gt;http://localhost:8080/nifi-api/controller-services/61fc97d3-0160-1000-49e3-46201fe71092&lt;/A&gt;&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;Explanation:-&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;DBCPConnectionPool Controller service id is
61fc97d3-0160-1000-49e3-46201fe71092&lt;/P&gt;&lt;P&gt;we need to use state as &lt;STRONG&gt;DISABLED&lt;/STRONG&gt;
i.e we are disabling the service.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;4.Start
DBCPConnection Pool Controller service&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Just change the state to &lt;STRONG&gt;ENABLED&lt;/STRONG&gt; then the controller service will be enabled.&lt;/P&gt;&lt;PRE&gt;curl -i -X PUT -H 'Content-Type:application/json' -d
'{"revision":{"clientId":"6082f82f-0160-1000-c7de-88e9e0df0382","version":1},"component":{"id":"61fc97d3-0160-1000-49e3-46201fe71092","state":"ENABLED"}}'
&lt;A href="http://localhost:8080/nifi-api/controller-services/61fc97d3-0160-1000-49e3-46201fe71092" target="_blank" rel="nofollow noopener noreferrer"&gt;http://localhost:8080/nifi-api/controller-services/61fc97d3-0160-1000-49e3-46201fe71092&lt;/A&gt;&lt;/PRE&gt;&lt;P&gt;To find the version number just use the same method using
developer tools as i mentioned above.&lt;/P&gt;&lt;P&gt;In addition if you want to stop and start Process Groups use the below curl commands&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;To Stop the Process Group:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;My P&lt;STRONG&gt;rocess Group id&lt;/STRONG&gt; is &lt;STRONG&gt;5d325978-0160-1000-f734-cbbf324b3ec3&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;To stop process group &lt;STRONG&gt;state&lt;/STRONG&gt; needs to be &lt;STRONG&gt;STOPPED&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;curl -i -X PUT -H 'Content-Type: application/json' -d '{"id": "5d325978-0160-1000-f734-cbbf324b3ec3","state": "STOPPED"}' &lt;A href="http://localhost:8080/nifi-api/flow/process-groups/5d325978-0160-1000-f734-cbbf324b3ec3" target="_blank" rel="nofollow noopener noreferrer"&gt;http://localhost:8080/nifi-api/flow/process-groups/5d325978-0160-1000-f734-cbbf324b3ec3&lt;/A&gt;&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;To Start Process Group:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Change the &lt;STRONG&gt;state&lt;/STRONG&gt; to &lt;STRONG&gt;RUNNING&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;curl -i -X PUT -H 'Content-Type: application/json' -d '{"id": "5d325978-0160-1000-f734-cbbf324b3ec3","state": "RUNNING"}' &lt;A href="http://localhost:8080/nifi-api/flow/process-groups/5d325978-0160-1000-f734-cbbf324b3ec3" target="_blank" rel="nofollow noopener noreferrer"&gt;http://localhost:8080/nifi-api/flow/process-groups/5d325978-0160-1000-f734-cbbf324b3ec3&lt;/A&gt;&lt;/PRE&gt;&lt;P&gt;By using Rest Api commands prepare a script that will trigger
before PutSQL processor.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Script:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;1.Stop the PutSQL Processor&lt;/P&gt;&lt;P&gt;2.Disable DBCP Connection Pool&lt;/P&gt;&lt;P&gt;3.Enable DBCP Connection Pool&lt;/P&gt;&lt;P&gt;4.Start PutSQL Processor&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.cloudera.com/legacyfs/online/attachments/44454-restapi-cmnds.txt" target="_blank"&gt;restapi-cmnds.txt&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 03:39:36 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/dbcpconnection-pool-drops-connection/m-p/213361#M69669</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2019-08-18T03:39:36Z</dc:date>
    </item>
    <item>
      <title>Re: dbcpconnection pool drops connection.</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/dbcpconnection-pool-drops-connection/m-p/213362#M69670</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.hortonworks.com/users/44442/jonathanbell.html"&gt;&lt;/A&gt;&lt;A rel="user" href="https://community.cloudera.com/users/18929/yaswanthmuppireddy.html" nodeid="18929"&gt;@Shu&lt;/A&gt;  can you please guide, how to trigger the rest api command scripts in NiFi which you have suggested in this post&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2019 13:38:52 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/dbcpconnection-pool-drops-connection/m-p/213362#M69670</guid>
      <dc:creator>bhanupro32</dc:creator>
      <dc:date>2019-04-24T13:38:52Z</dc:date>
    </item>
  </channel>
</rss>

