database - 连接池 什么是 removeAbandoned?

标签 database jdbc connection-pooling

什么是放弃的连接?如果我设置会发生什么 removeAbandoned = 假?

谢谢!

最佳答案

被放弃的连接是应用程序用来执行某些任务但应用程序未关闭它们或在过程中出现某些异常而未关闭它们的连接。

设置 removeAbandoned = false 可能会导致连接中断错误,因为有太多连接处于放弃状态,然后您的应用程序将耗尽连接。将没有任何连接可用于执行任务。

设置 removeAbandoned = true 将在为 removeAbandonedTimeout 设置的时间限制后关闭连接。

此问题是由于应用程序中的连接泄漏引起的。

根据 Tomcat页:

(boolean) Flag to remove abandoned connections if they exceed the removeAbandonedTimeout. If set to true a connection is considered abandoned and eligible for removal if it has been in use longer than the removeAbandonedTimeout Setting this to true can recover db connections from applications that fail to close a connection. See also logAbandoned The default value is false.

关于database - 连接池 什么是 removeAbandoned?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42636215/

相关文章:

database - 如何利用 PostgreSQL DDL 解析器?

php - 数据库凭据的安全存储

java - while(rs.next()) 是否比一系列 rs.absolute() 更快

java - 我们可以将 Oracle RECORD TYPE 与 java Callable 语句集成吗?

java - Servlet 代码中的结果集处理错误

performance - PooledCloseableHttpClient 影响性能吞吐量

sql - 在 MySQL 中使用多个表和/或在 Rails 应用程序中使用多个列

redis - 将转储文件加载到 redis 数据库的问题

java - 在没有随机阻塞方法调用的情况下使用 ThreadPoolExecutor 和连接池

c# - 为什么 sysprocesses 在 SQL Server 上长时间处于打开状态?