c3p0出现 An attempt by a client to checkout a Connection has timed out
java.sql.SQLException: An attempt by a client to checkout a Connection has timed out.
at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:106)
at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:65)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:527)
at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:128)
Caused by: com.mchange.v2.resourcepool.TimeoutException: A client timed out while waiting to acquire a resource from com.mchange.v2.resourcepool.BasicResourcePool@a0e5175 -- timeout at awaitAvailable()
at com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:1317)
at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:557)
at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:590)
at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:590)
at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:590)
at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:590)
at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:590)
at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:590)
at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:590)
at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:477)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:525)
... 7 more
解决方法:缓存关闭也就是把c3p0.max_statements 设置成0(假设不设置为0,可能造成connection不能真正被关闭),这样就不会有缓存的preparedstatement。而设置的c3p0.idle_test_period又小于c3p0.timeout,这种设置应该解决这个问题了。
c3p0出现 An attempt by a client to checkout a Connection has timed out的更多相关文章
- paip.提升稳定性---c3p0数据库连接池不能取到连接An attempt by a client to checkout a Connection has timed out
paip.提升稳定性---c3p0数据库连接池不能取到连接An attempt by a client to checkout a Connection has timed out 作者Attilax ...
- mysql数据库连接出问题,提示超时 java.sql.SQLException: An attempt by a client to checkout a Connection has timed out.解决办法
mysql数据库连接出问题,提示超时,后来发现问题在于连接mysql数据库的jar包跟数据库版本不对应导致的,更换jar包一致就解决了.
- log报错: Caused by: java.sql.SQLException: An attempt by a client to checkout a Connection has timed out.
报错: 解决方式: 1.登录数据库查看错误原因 结果发现账号无法正常登录出现账号被锁定的错误. 2.如何账号解锁? 用sys系统管理员账号登录数据库 SQL> alter user 用户名 ac ...
- 报错: Could not open JDBC Connection for transaction; nested exception is java.sql.SQLException: An attempt by a client to checkout a Connection has timed out. 数据库连接超时
解决方法一: [oracle@data ~]$ sqlplus / as sysdba——连接到数据库 SQL*Plus: Release 11.2.0.4.0 Production on Mon M ...
- ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: An attempt by a client to chec
数据库连接超时,是数据库连接时的相关配置写错,例如:数据库密码,驱动等问题
- Server Tracking of Client Session State Changes Connection Management
MySQL :: MySQL 8.0 Reference Manual :: 5.1.12 Connection Management https://dev.mysql.com/doc/refman ...
- ssh+c3p0调用存储过程、组拼STRUCT时仅使用一个connection的方法 c3p0代理类转原始类(connection)
正常情况,我们会调用存储过程用hibernate提供的连接池代理连接类来调用存储过程,而用新建连接给存储过程组拼STRUCT. 但是这样感觉可以再一步的优化:调用存储过程与构建STRUCT用hiber ...
- c3p0私有属性checkoutTimeout设置成1000引发的调试错误:
checkoutTimeout设置成1000引发的调试错误: org.mybatis.spring.MyBatisSystemException: nested exception is org.ap ...
- c3p0获取连接Connection后的Close()---释疑
论题: java c3p0获取连接Connnection 之后, 调用 con.close( ) 是否真的关闭了物理连接 ? 简答: c3p0采用连接池, 目的就是提前预置一定数量的连接, 在使用时候 ...
随机推荐
- HTML、CSS规范
作为一名前端开发者,至少要对HTML.CSS规范有个了解,然后尝试在项目是使用,以便别人阅读你代码的时候,也相对轻松点. HTML.CSS规范,参见:编码规范 by @mdo JavaScript 参 ...
- canvas处理图片
canvas绘制图片的三种方法: drawImage(image, x, y) drawImage(image, x, y, width, height) drawImage(image, sourc ...
- 《Unix环境高级编程》读书笔记 第13章-守护进程
1. 引言 守护进程是生存期长的一种进程.它们常常在系统引导装入时启动,仅在系统关闭时才终止.它们没有控制终端,在后台运行. 本章说明守护进程结构.如何编写守护进程程序.守护进程如何报告出错情况. 2 ...
- 洛谷P3567 [POI2014]KUR-Couriers 主席树
挺裸的,没啥可讲的. 不带修改的主席树裸题 Code: #include<cstdio> #include<algorithm> using namespace std; co ...
- 解决PNG图片在IE6中背景不透明方法_解决IE6中PNG背
解决PNG图片在IE6中背景不透明方法_解决IE6中PNG背 目录 解决代码 解决png图片在html中 解决png作为网页背景-css 1.解决PNG图片在IE6中背景不透明的CSS与JS代码 ...
- C语言基础 (1) 操作系统介绍,linux入门
第一天 一.操作系统 1.1.1操作系统的目标 ·方便:使计算机系统易于使用 ·有效:以更有效的方式使用计算机系统资源 ·扩展:方便用户有效开发.测试和引进新功能 1.1.2 操作系统的地位 操作系统 ...
- 紫书 习题 8-1 UVa 1149(贪心)
排序之后, 尽量最小和最大的放在一个背包, 放不下就放最大的. #include<cstdio> #include<algorithm> #define REP(i, a, b ...
- Vue中如何监控某个属性值的变化?
比如现在需要监控data中, obj.a 的变化.Vue中监控对象属性的变化你可以这样: deep属性表示深层遍历,但是这么写会监控obj的所有属性变化,并不是我们想要的效果,所以做点修改: 还有一种 ...
- VS2015--win32project配置的一些想法之cmake
近期两天都在配置一个win32项目.为了实现跨平台,写底层代码的人仅仅build了安卓和ios的工程,没有build win32项目. 因为对一些库不是非常了解.配置起来非常困难,心力交瘁. 为了实现 ...
- c++_benchMark_vector_list_deque
title: c++_benchMark_vector_list_deque date: 2015-08-01 22:32:39 作者:titer1 + ZhangYu 出处:www.drysalte ...