背景:C3P0数据库连接池占满

Configuring to Debug and Workaround Broken Client Applications

http://www.mchange.com/projects/c3p0/#configuring_to_debug_and_workaround_broken_clients

Sometimes client applications are sloppy about close()ing all Connections they check out. Eventually, the pool grows to
maxPoolSize, and then runs out of Connections, because of these bad clients.

The right way to address this problem is to fix the client application. c3p0 can help you debug, by letting you know where Connections are checked out that occasionally don't get checked in. In rare and unfortunate situations, development of the
client application is closed, and even though it is buggy, you cannot fix it. c3p0 can help you work around the broken application, preventing it from exhausting the pool.

The following parameters can help you debug or workaround broken client applications.

unreturnedConnectionTimeout defines a limit (in seconds) to how long a Connection may remain checked out. If set to a nozero value, unreturned, checked-out Connections that exceed this limit will be summarily destroyed, and then replaced in the
pool. Obviously, you must take care to set this parameter to a value large enough that all intended operations on checked out Connections have time to complete. You can use this parameter to merely workaround unreliable client apps that fail to close() Connections.

Much better than working-around is fixing. If, in addition to setting
unreturnedConnectionTimeout, you set debugUnreturnedConnectionStackTraces to
true, then a stack trace will be captured each time a Connection is checked-out. Whenever an unreturned Connection times out, that stack trace will be printed, revealing where a Connection was checked out that was not checked in promptly.
debugUnreturnedConnectionStackTraces is intended to be used only for debugging, as capturing a stack trace can slow down Connection check-out.

Configuring to Debug and Workaround Broken Client Applications的更多相关文章

  1. Asynchronous vs synchronous client applications(MQTT)

    来自我的CSDN博客   想查看英文原文的请点击原文网址.在上两篇翻译中,Homejim我给大家分别翻译了同步客户端应用程序和异步客户端应用程序.本人对这两个的区别也有困惑,因此将paho下的这个比较 ...

  2. Learning WCF Chapter1 Generating a Service and Client Proxy

    In the previous lab,you created a service and client from scratch without leveraging the tools avail ...

  3. [转]Publishing and Running ASP.NET Core Applications with IIS

    本文转自:https://weblog.west-wind.com/posts/2016/Jun/06/Publishing-and-Running-ASPNET-Core-Applications- ...

  4. 通过Instant Client包来使用SQL*PLUS

    1.首先下载两个程序包: Instant Client Package - Basic(或Instant Client Package - Basic Lite)包 Instant Client Pa ...

  5. udhcpd源码分析4--获取client报文及发包动作

    1:重要的结构体 获取的报文是UDP的payload部分,结构体struct dhcpMessage描述了dhcp报文的结构. /* packet.h */ struct dhcpMessage { ...

  6. 微软职位内部推荐-Principal DEV Manager for Bing Client

    微软近期Open的职位: Title: Principal DEV Manager for Bing ClientGroup: Search Technology Center Asia, BingW ...

  7. .net framework client profile

    .NET Framework Client Profile The .NET Client Profile is a subset of the .NET Framework, which was p ...

  8. MQTT Client library for C (MQTT客户端C语言库-paho)

    原文:http://www.eclipse.org/paho/files/mqttdoc/MQTTClient/html/index.html 来自我的CSDN博客   最近在使用Paho的MQTT客 ...

  9. [转]Consuming a OData Service in a Client Application (WCF Data Services)

    本文转自:https://msdn.microsoft.com/zh-tw/library/dd728282(v=vs.103).aspx WCF Data Services 5.0   其他版本   ...

随机推荐

  1. CSS表格属性

    border-collapse:表格边框线合并,取值:collapse.

  2. python的__file__和__name__变量

    #现在的目录结构为 #现在想要在web2/bin.py中调用web3/main.py模块中的方法 from web3 import main main.foo() #在pycharm中执行 ##### ...

  3. day 72 Django基础七之Ajax

    Django基础七之Ajax   本节目录 一 Ajax简介 二 Ajax使用 三 Ajax请求设置csrf_token 四 关于json 五 补充一个SweetAlert插件(了解) 六 同源策略与 ...

  4. WEB前端使用的CSS3选择器

    首先说first-child与last-child,这两个选择器很容易明白,就是父元素下的第一个子元素和最后一个子元素.而nth-child和nth-last-child则是父元素下指定序号的子元素, ...

  5. Qt下QMainWindow内部QTableView不能自适应大小

    中央窗体设置的是一个QWidget 一直排查不到原因 最后发现为 因为布局中为QTableView设置了对齐方式 取消即可!

  6. C++ 系列:Boost Thread 编程指南

    转载自:http://www.cppblog.com/shaker/archive/2011/11/30/33583.html 作者: dozbC++ Boost Thread 编程指南0 前言1 创 ...

  7. CF755F PolandBalls and Gifts

    题意:给你一个礼物的置换.有k个人忘带了礼物.一个人无法获得礼物为他自己没有带礼物或给他带礼物的那个人没有带礼物.求选择k个人,没有获得礼物的人数的最小值和最大值. n,k<=1e6. 标程: ...

  8. Java虚拟机性能管理神器 - VisualVM(5) 监控远程主机上的JAVA应用程序【转】

    Java虚拟机性能管理神器 - VisualVM(5) 监控远程主机上的JAVA应用程序[转] 标签: javajvm监控工具性能优化 2015-03-11 18:37 1394人阅读 评论(0) 收 ...

  9. 在DataWorks中实现指定UDF只能被指定账户访问

    背景 之前写过一篇文章是关于“DataWorks和MaxCompute内部权限体系的区别”有兴趣的朋友可以点击阅读查看详情.但是还是有些同学会问,我如何在DataWorks中实现我的具体某个Resou ...

  10. nc 文件的nan识别

    表现形式:print()结果为 --      打印type为numpy.ma.core.MaskedConstant 使用 if type(x) == np.ma.core.MaskedConsta ...