• c3p0私有属性checkoutTimeout设置成1000引发的调试错误:


    checkoutTimeout设置成1000引发的调试错误:

    org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:
    ### Error updating database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: An attempt by a client to checkout a Connection has timed out.
    ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: An attempt by a client to checkout a Connection has timed out.

    -------------------------------------------------------------------------------------------------------------------

    c3p0私有属性配置:

    # 始化时创建的连接数,应在minPoolSize与maxPoolSize之间取值。默认为3
    initialPoolSize=20
    # 接池中保留的最大连接数。默认为15
    maxPoolSize=30
    minPoolSize=20
    # 当连接池中的连接用完时,C3P0一次性创建新连接的数目 默认 3
    acquireIncrement=10
    # 定义在从数据库获取新连接失败后重复尝试获取的次数,默认为30
    acquireRetryAttempts=100
    # 两次连接中间隔时间,单位毫秒,默认为1000
    acquireRetryDelay=1000
    # 连接关闭时默认将所有未提交的操作回滚。默认为false
    autoCommitOnClose=false
    # 获取连接失败将会引起所有等待获取连接的线程抛出异常。但是数据源仍有效保留,并在下
    # 次调用getConnection()的时候继续尝试获取连接。如果设为true,那么在尝试获取连接
    # 失败后该数据源将申明已断开并永久关闭。默认为false
    breakAfterAcquireFailure=false
    # 当连接池用完时客户端调用getConnection()后等待获取新连接的时间,超时后将抛出   
    # SQLException,如设为0则无限期等待。单位毫秒,默认为0
    checkoutTimeout=20000
    # 最大空闲时间,超过空闲时间的连接将被丢弃。为0或负数则永不丢弃。默认为0
    maxIdleTime=60
    # 每60秒检查所有连接池中的空闲连接。Default: 0
    idleConnectionTestPeriod=60
    # C3P0是异步操作的,缓慢的JDBC操作通过帮助进程完成。扩展这些操作可以有效的提升性能
    #通过多线程实现多个操作同时被执行。默认为3
    numHelperThreads=3
    # 用户修改系统配置参数执行前最多等待的秒数。默认为300
    propertyCycle=300
    maxStatements=0
     
    -----------------------------------------------------------------------------------------------------------------------------
    # 当连接池用完时客户端调用getConnection()后等待获取新连接的时间,超时后将抛出   
    # SQLException,如设为0则无限期等待。单位毫秒,默认为0
    checkoutTimeout=20000
     
    时间设置过小时会出现连接超时.这样会抛出异常,设置时间时自己小心.按照实际情况设置适当的值.
     
  • 相关阅读:
    debian的xfce内多余的菜单位置
    cocos2dx学习笔记之图片分辨率适配
    cocos2dx学习笔记之辅助工具
    cocos2dx游戏开发必备工具之PhysicsEditor【ZT】
    cocos2dx学习笔记之粒子效果
    mac下直接下载xcode的地址
    无需花生壳,dnspod实现ddns
    android和view相关的东西
    android的一些经典三方库
    简单工厂模式扩展工厂方法模式
  • 原文地址:https://www.cnblogs.com/LvLoveYuForever/p/5935732.html
Copyright © 2020-2023  润新知