<转>quartz 2.2.1 jdbc 连接池参数配置
2017-09-04 10:00
453 查看
线上数据库出现mysql 8小时异常.需要增加如下配置:
增加后问题解决.
转载:http://www.cnblogs.com/snowlove67/p/4958406.html
参考:(quartz和数据库断连接的解决办法)
http://blog.csdn.net/bewilderment/article/details/47951269
quartz连接池配置对C3PO连接池配置进行了一些封装, 留作记录。
mysql 断开连接可以通过设置 validateOnCheckout=true + validationQuery
或者设置discardIdleConnectionsSeconds 少于8小时解决。
org.quartz.dataSource.QRTZ_DS.idleConnectionValidationSeconds=60 org.quartz.dataSource.QRTZ_DS.validateOnCheckout=true org.quartz.dataSource.QRTZ_DS.discardIdleConnectionsSeconds=0
增加后问题解决.
转载:http://www.cnblogs.com/snowlove67/p/4958406.html
参考:(quartz和数据库断连接的解决办法)
http://blog.csdn.net/bewilderment/article/details/47951269
/** The JDBC database driver. */指定连接驱动 public static final String DB_DRIVER = "driver"; /** The JDBC database URL. */ 连接字符串 public static final String DB_URL = "URL"; /** The database user name. */ 用户名 public static final String DB_USER = "user"; /** The database user password. */ 密码 public static final String DB_PASSWORD = "password"; /** The maximum number of database connections to have in the pool. Default is 10. */ 连接池最大连接数 public static final String DB_MAX_CONNECTIONS = "maxConnections"; /** * The maximum number of prepared statements that will be cached per connection in the pool. * Depending upon your JDBC Driver this may significantly help performance, or may slightly * hinder performance. * Default is 120, as Quartz uses over 100 unique statements. 0 disables the feature. */ 每个链接最多缓存多少个预编译语句 public static final String DB_MAX_CACHED_STATEMENTS_PER_CONNECTION = "maxCachedStatementsPerConnection"; /** * The database sql query to execute every time a connection is returned * to the pool to ensure that it is still valid. */ 验证连接是否可用的查询语句 public static final String DB_VALIDATION_QUERY = "validationQuery"; /** * The number of seconds between tests of idle connections - only enabled * if the validation query property is set. Default is 50 seconds. */ 多久验证空闲连接 public static final String DB_IDLE_VALIDATION_SECONDS = "idleConnectionValidationSeconds"; /** * Whether the database sql query to validate connections should be executed every time * a connection is retrieved from the pool to ensure that it is still valid. If false, * then validation will occur on check-in. Default is false. */ 是否每次从池中取连接时,验证连接可用性 public static final String DB_VALIDATE_ON_CHECKOUT = "validateOnCheckout"; /** Discard connections after they have been idle this many seconds. 0 disables the feature. Default is 0.*/ 空闲连接超过多少秒丢弃 private static final String DB_DISCARD_IDLE_CONNECTIONS_SECONDS = "discardIdleConnectionsSeconds"; /** Default maximum number of database connections in the pool. */ 最大连接数 public static final int DEFAULT_DB_MAX_CONNECTIONS = 10; /** Default maximum number of database connections in the pool. */ 默认每个链接缓存120个预编译语句 public static final int DEFAULT_DB_MAX_CACHED_STATEMENTS_PER_CONNECTION = 120;
quartz连接池配置对C3PO连接池配置进行了一些封装, 留作记录。
mysql 断开连接可以通过设置 validateOnCheckout=true + validationQuery
或者设置discardIdleConnectionsSeconds 少于8小时解决。
相关文章推荐
- quartz 2.2.1 jdbc 连接池参数配置
- 回发或回调参数无效。在配置中使用 <pages enableEventValidation= "true "/> 或在页面中使用 <%@ Page EnableEventValidation= "true " %> 启用了事件验证
- <value>${jdbc.driverClassName}</value>解读——PropertyPlaceholderConfigurer读取配置文件
- JVM相关参数配置和问题诊断<转>
- spring4.1.6配置quartz2.2.1(maven) <转>
- php-fpm 启动参数及重要配置详解<转>
- SSM框架中Mybatis向映射文件(XML)的<insert>元素传入多个数组参数的问题
- Seam中细粒度配置文件(*.page.xml)的<param >理解
- DBCP连接池配置参数说明
- Spring配置文件中使用ref local与ref bean的区别. 在ApplicationResources.properties文件中,使用<ref bean>与<ref local>方法如下
- <iOS开发>之host配置(Mac)
- <welcome-file-list>action配置
- 回发或回调参数无效。在配置中使用...pages enableEventValidation="true"/>
- 汇总 Hibernate 与 jdbc,jndi+dbcp, proxool ,c3p0 连接池的配置
- JDBC:配置resin中的数据库连接池
- 任务调度框架Quartz(五)Quartz任务调度框架之最全Quartz系统参数配置详解
- JDBC在Tomcat中配置数据库(MSSQL和ORACLE)连接池的配置文件(server.xml)
- [J2EE]DBCP、C3P0、Proxool三大连接池的配置参数说明和使用详解
- JDBC URL中关于字符编码的配置参数
- <转载> nginx服务器安装及配置文件详解 https://segmentfault.com/a/1190000002797601