MYSQL 8 Hours Time out Problem
2015-10-16 13:17
579 查看
I am using MYSQL 5.0 and Tomcat 5.5. After 8 hours , MYSQL closes by default all idle connections and so I am getting an SQL Exception .Any solution to this problem
Which connection pool are you using? Most allow a heartbeat command to be executed periodically to keep connections from idling out.
EDIT: Looking at the DBCP configuration page, I think you should set an appropriate (cheap)
Which connection pool are you using? Most allow a heartbeat command to be executed periodically to keep connections from idling out.
EDIT: Looking at the DBCP configuration page, I think you should set an appropriate (cheap)
validationQuery. You could then either tell DBCP to test this when potentially evicting idle connections (
testWhileIdle) or tell it to test just before returning the connection (
testOnBorrow). The first would (hopefully!) keep your idle connections alive; the second wouldn’t, but wouldn’t return you broken connections (i.e. if would create a new one if necessary).
相关文章推荐
- MySQL: Create Master - Slave Servers
- MySQL错误ERROR 2002 (HY000): Can't connect to local MySQL server
- 记一次mysql启动不了的问题
- mysql出现乱码
- ubuntu系统内mysql出现乱码
- mysql数据库导入导出
- ubuntu下卸载mysql重装
- mysql获取插入时自增ID值的方法
- 执行脚本拉去远程服务器mysql数据
- 数据库_MySQL_查询时强制区分大小写的方法
- MySQL数据库知识点
- mysql升级报错innodb_table_stats" not found处理
- Mysql新增自增长主键列
- backup mysql for xtrabackup with xbstream and lz4
- mysql set赋值与select into 赋值的区别
- VBA连接MYSQL数据库(转载有修改)
- JDBC与MySql:手把手教你JDBC入门
- mysql 数据库分区
- servlet中访问mysql无法包含中文的解决
- mysql语句总结