背景: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. Vue入坑——vue-cli(脚手架)目录结构认识

    转载:https://my.oschina.net/u/3802541/blog/1809182 一.目录结构 |-- build                            // 项目构建 ...

  2. (转)Python成长之路【第九篇】:Python基础之面向对象

    一.三大编程范式 正本清源一:有人说,函数式编程就是用函数编程-->错误1 编程范式即编程的方法论,标识一种编程风格 大家学习了基本的Python语法后,大家就可以写Python代码了,然后每个 ...

  3. LightOJ-1214-Large Division-大数取余

    Given two integers, a and b, you should check whether a is divisible by b or not. We know that an in ...

  4. 微信小程序 主题皮肤切换(switch开关)

    示例效果: 功能点分析: 1.点击switch开关,切换主题皮肤(包括标题栏.底部tabBar):2.把皮肤设置保存到全局变量,在访问其它页面时也能有效果3.把设置保存到本地,退出应用再进来时,依然加 ...

  5. 第二周课堂笔记1th

    1.    三元运算 + 2.      for循环 for为有限循环,while为无限循环 可迭代对象:是字符串,数字不可以 数字不可以迭代但是可以用range函数 for i in range(1 ...

  6. 廖雪峰Java15JDBC编程-3JDBC接口-2JDBC查询

    我们可以使用JDBC查询来执行select语句. 1. Statement try(Connection conn = DriverManager.getConnection(JDBC_URL, JD ...

  7. 【Uva 12128】Perfect Service

    [Link]: [Description] 给你n个机器组成的一棵树,然后,让你在某些机器上安装服务器. 要求,每个机器如果没有安装服务器,都要恰好和一个安装了服务器的机器连接. 问你,最少要安装多少 ...

  8. python下使用ElasticSearch

    一 什么是 ElasticSearch Elasticsearch 是一个分布式可扩展的实时搜索和分析引擎,一个建立在全文搜索引擎 Apache Lucene(TM) 基础上的搜索引擎.当然 Elas ...

  9. centos6 nginx 配置本地https访问

    安装准备 yum install openssl openssl-devel 生成文件 cd /usr/local/nginx/conf # 生成密钥privkey.pem: openssl genr ...

  10. Box 'laravel/homestead' could not be found.

    vbox vagrant.box Homestead 都安裝好的情況下.在homestead目錄下,執行vagrant up出錯 Homestead\scripts\文件夹中,打开homestead. ...