什么是放弃的连接?如果我设置会发生什么 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/