unreturnedConnectionTimeout

unreturnedConnectionTimeout

本文介绍了生产中C3P0:unreturnedConnectionTimeout?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

参数 unreturnedConnectionTimeout 在给定的一段时间后超时未返回的连接。我正在尝试决定是否应该在我的生产 persistence.xml 中使用它?使用它的一大优点是连接池将能够从泄漏的连接中恢复。一个很大的缺点是漏洞连接很难被发现。

The parameter unreturnedConnectionTimeout times out unreturned connections after a given period of time. I'm trying to decide whether I should use this in my production persistence.xml? A big plus of using this is that the Connection Pool will be able to recover from leaky connections. A big minus is that leaky connections will be very difficult to detect.

我应该在生产应用程序中使用 unreturnedConnectionTimeout 吗?如果是的话,它的价值应该是什么?我应该考虑其他优点/缺点吗?

Should I use unreturnedConnectionTimeout in production applications? If yes, what should its value be? Are there any other pros/cons I should consider?

推荐答案

您应该调试Connection泄漏,然后不要使用 unreturnedConnectionTimeout 在生产中,理想情况下。

You should debug your Connection leaks, and then not use unreturnedConnectionTimeout in production, ideally.

要调试连接泄漏,请设置 unreturnedConnectionTimeout debugUnreturnedConnectionStackTraces ,请参阅(存档)。然后,当你没有更多泄漏时,取消设置这两个参数。

To debug Connection leaks, set both unreturnedConnectionTimeout and debugUnreturnedConnectionStackTraces, see http://www.mchange.com/projects/c3p0/#configuring_to_debug_and_workaround_broken_clients (archived here). Then, when you have no more leaks, unset both of these parameters.

你应该在生产中设置 unreturnedConnectionTimeout 如果由于某种原因你不能调试和修复其Connections泄漏的应用程序,在这种情况下,只需设置 unreturnedConnectionTimeout 是一个合理的解决方法,让c3p0清理你的应用程序忘记了。

You would set unreturnedConnectionTimeout in production mostly if for some reason you can't debug and fix the application whose Connections are leaking, in which case it's a reasonable workaround to just set unreturnedConnectionTimeout and let c3p0 clean up what your application forgets to.

这篇关于生产中C3P0:unreturnedConnectionTimeout?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-12 09:28