`
chembo
  • 浏览: 941080 次
  • 性别: Icon_minigender_1
  • 来自: 广州
社区版块
存档分类
最新评论

c3p0连接错误 An attempt by a client to checkout a Connection has timed out.

阅读更多
c3p0作为连接池,报:java.sql.SQLException: An attempt by a client to checkout a Connection has timed out.
网上查了很久,有人说是checkoutTimeout太短的原因,(Default: 0)于是由原来的1000改为2000,问题还是未解决。
然后找了份没有问题的配置作了些对比,发现我的maxPoolSize=100显得有些大,于是改为默认的15.再测试,居然没有问题了。后来再试了大一点的60,也没有问题。
下面是我的配置:
<bean id="dataSource"
		class="com.mchange.v2.c3p0.ComboPooledDataSource"
		destroy-method="close">
		<property name="driverClass" value="com.mysql.jdbc.Driver" />
		<property name="jdbcUrl"
			value="jdbc:mysql://localhost:3306/gjp" />
		<property name="user" value="root" />
		<property name="password" value="gjpgjp" />
		<property name="initialPoolSize" value="20" />
		<property name="minPoolSize" value="10" />
		<property name="maxPoolSize" value="60" />
		<property name="maxIdleTime" value="7200" />
		<property name="idleConnectionTestPeriod" value="360" />
		<property name="preferredTestQuery" value="select 1" />
		<property name="acquireIncrement" value="5" />
		<property name="acquireRetryAttempts" value="50" />
		<property name="acquireRetryDelay" value="1000" />
		<property name="breakAfterAcquireFailure" value="true" />
		<property name="checkoutTimeout" value="20000" />
		<property name="autoCommitOnClose" value="false" />
		<property name="forceIgnoreUnresolvedTransactions" value="false" />
		<property name="unreturnedConnectionTimeout" value="1000" />
		<property name="maxStatements" value="0" />
		<property name="maxStatementsPerConnection" value="0" />
		<property name="testConnectionOnCheckin" value="true" />
		<property name="testConnectionOnCheckout" value="false" />
		<property name="usesTraditionalReflectiveProxies" value="false" />
		<property name="numHelperThreads" value="5" />
	</bean>
分享到:
评论
1 楼 wx_hello 2015-03-04  
dataSource.setMaxPoolSize(30); // 连接池中保留的最大链接数,默认是15


我的是30就报这个问题了。。。不晓得什么原因。。。



我用loadrunner跑了下。。20个用户,跑了三分钟之后,再次登录系统就这个错误

相关推荐

    mysql密码过期导致连接不上mysql

    mysql密码过期了,今天遇到了连接mysql,总是连接不上去, 错误现象1: An attempt by a client to checkout a Connection has timed out 第一次出现连接超时错误,第一反应是去修改cpool.checkoutTimeout参数为...

    c3p0数据库连接

    DataSourceUtils.java c3p0数据库连接

    Introduction.To.Algorithms,.Second.Edition

    Algorithms are described in English and in a "pseudocode" designed to be readable by anyone who has done a little programming. The book contains over 230 figures illustrating how the algorithms work. ...

    计算机网络第六版答案

    An ISP earns its money by charging each of the the ISPs that connect to the IXP a relatively small fee, which may depend on the amount of traffic sent to or received from the IXP. 15. Google's ...

    orcad15.7 破解方法

    orcad15.7 安装问题解决:An application has made an attempt to load the C runtime library incorrectly. Please ccontact the application"s support team for more information!

    An attempt at a C++ tutorial..zip

    总的来说,"An attempt at a C++ tutorial"可能涵盖了以上提到的所有或部分主题,旨在为初学者提供一个全面的C++学习路径。通过逐步学习并实践这些概念,你可以逐渐精通C++,并能够编写出高质量的代码。

    BURNINTEST--硬件检测工具

    - Updated license management, in an attempt to remove a rare crash on startup. Release 5.3 build 1012.0002 WIN32 release 31 October 2007 - New build of Rebooter (64-bit Windows correction). - ...

    Kerberos Administration Guide

    The Kerberos protocol uses strong cryptography so that a client can prove its identity to a server (and vice versa) across an insecure network connection. After a client and server has used Kerberos ...

    expect4j.jar 1.0

    Expect4j is an attempt to rewrite Expect in Java and provide bindings to the TclJava interpreter. The goal is to be able to port existing Tcl code bases that use Expect directly to Java without ...

    微软内部资料-SQL性能优化3

    For example, suppose a transaction scanned a page using an S lock and then subsequently decided to perform a row level update. The row would obtain an X lock, but now the page would require an IX ...

    VB编程资源大全(英文源码 网络)

    You can send messages with a client/server type setup.&lt;END&gt;&lt;br&gt;57 , al40.zip Apparently, if you use AOL to connect to the Internet and you do not touch it for 45 minutes it will timeout and drop ...

    【ASP.NET编程知识】.net core并发下线程安全问题详解.docx

    异常5“Object reference not set to an instance of an object”是经典的空引用异常,意味着尝试访问的对象尚未初始化。这可能由于代码中的null检查不足导致,需要在访问对象属性或方法前确保对象已被正确实例化。 ...

    2009 达内Unix学习笔记

    ftp工具 192.168.0.202 tools-toolss 老师测评网址 http://172.16.0.198:8080/poll/ 各个 shell 可互相切换 ksh:$ sh:$ csh:guangzhou% bash:bash-3.00$ 一、注意事项 命令和参数之间必需用空格隔开,参数和...

    A Practical Guide to Designing with Data.pdf

    new ʻvisualizationsʼ are an attempt to explain the underlying information with a powerful visual impact. They take complex ideas and distil them into beautiful graphics revealing the ...

    An attempt to read, understand, and implement the AUTOSAR SWS Po

    An attempt to read, understand, and implement the AUTOSAR SWS Port Driver according to the specification in a demo full-layered AUTOSAR a…

    Impactor_0.9.51

    Also: Tons of people are downloading Cydia Impactor in an attempt to install some kind of Pokemon Go hack in the form of an IPA file... to their Android device... an IPA file is for devices running ...

    php.ini-development

    data to the client. If your application's output exceeds this setting, PHP ; will send that data in chunks of roughly the size you specify. ; Turning on this setting and managing its maximum buffer ...

Global site tag (gtag.js) - Google Analytics