DBCP:removeAbandoned VS 驱逐

发布于 2024-11-18 18:29:36 字数 284 浏览 2 评论 0原文

我无法弄清楚removeAbandoned驱逐之间的区别。我在某处读到,removeAbandoned 已被弃用,但官方文档中没有提及(http:// commons.apache.org/dbcp/configuration.html)。

因此,如果有人能启发我,我将不胜感激:)

谢谢!

I fail to figure out the difference between removeAbandoned and eviction. I read somewhere that removeAbandoned was deprecated, but it is not mentionned anywhere in the official doc (http://commons.apache.org/dbcp/configuration.html).

So, if someone could enlighten me, it would be greatly appreciated :)

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

澉约 2024-11-25 18:29:36

它们意味着不同的事情:

  • 当应用程序不使用数据库连接(在池中空闲)足够长的时间,此时它被丢弃时,就会发生“驱逐”。
  • “放弃的连接”是指仍在使用的数据库连接。应用程序在一段一段时间后,通常足够长以表明连接正在泄漏

驱逐并不表明您的代码有问题(只是应用程序在连接爆发后需要更少的连接)但是放弃的连接意味着应用程序正在保留连接并且不会返回到池中。

They mean different things:

  • "eviction" occurs when a database connection is unused by the application (idle in the pool) for a long enough period of time at which point it's discarded
  • "abandoned connection" refers to database connection that is still in use by an application after some period of time, usually long enough to indicate that the connection is leaking

Eviction does not indicate a problem with your code (it's just that the application needs fewer connections after a burst of connections) but abandoned connections means that the application is holding on to a connection and is not returning to the pool.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文