无法获得连接,池错误超时等待PutSQL中的空闲对象? [英] Cannot get a connection, pool error Timeout waiting for idle object in PutSQL?

查看:332
本文介绍了无法获得连接,池错误超时等待PutSQL中的空闲对象?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将PutSQL处理器的并发任务增加为"10".

I have increased the concurrent tasks to be '10' for PutSQL processor.

那时它显示以下错误,但没有数据丢失.

At that time it shows below error but there is no data loss.

failed to process due to org.apache.nifi.processor.exception.ProcessException: org.apache.commons.dbcp.SQLNestedException: Cannot get a connection, pool error Timeout waiting for idle object; rolling back session: 

如果我删除了并发任务,那么它将正常工作而没有异常

if i have remove concurrent tasks then it worked without those exception

在Google出现此异常时,我在下面的链接中找到了答案

while google this exception i have found answer in below link

我越来越无法连接,池错误超时,等待空闲对象,当我尝试在Web应用程序中创建250个以上线程时

但是我不知道如何在NiFi putSQL中避免这个问题.

But i don't know how to avoid this issue in NiFi putSQL.

有人可以帮我解决这个问题吗?

Can anyone help me to resolve this?

推荐答案

当池管理器无法与正在等待的请求者建立可行的连接并且maxWait已通过从而触发超时时,将发生此异常. 原因有多种,但通常分为两大类:

This exception occurs when the pool manager cannot produce a viable connection to a waiting requester and the maxWait has passed therefore triggering a timeout. There are several causes, but they usually fall into 2 main categories:

  • 数据库已关闭或无法访问.
  • 连接池(设置为100个最大活动连接)没有连接.

默认情况下,nifi中的DBCPConnectionPool控制器服务的最大连接数为8,最大等待时间为500毫秒.当PutSQL处理器占用DBCP池中的8个连接并且请求第9个连接或超过最大连接限制时,它将引发无法获得连接"异常.

DBCPConnectionPool controller service in nifi has 8 max connection by default and 500 milli seconds max wait time. When PutSQL processor occupied 8 connection from DBCP pool and when it request for 9th connection or exceed the max connection limit then it will throw "Cannot get a connection" exception.

您可以尝试两种方法来避免此异常:

You can try 2 things to avoid this Exception :

  1. 您可以增加DBCPConnectionPool控制器中的最大等待时间"
    服务配置.
  2. 您可以在以下位置增加最大总连接数"限制 DBCPConnectionPool控制器服务配置.
  1. You can increase the "Max Wait Time" in DBCPConnectionPool controller
    service configuration.
  2. You can increase the "Max Total Connections" limit in DBCPConnectionPool controller service configuration.

请在下面的屏幕快照中进行更改.

Kindly find the below screenshot where you need to do changes.

它可能会解决您的问题.

It might resolve your issue.

这篇关于无法获得连接,池错误超时等待PutSQL中的空闲对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆