开发者社区> 问答> 正文

jfinal中c3p0断开连接:报错

@红薯 你好,想跟你请教个问题:你好,我在jfinal中写了一个定时器,mysql数据库,请教哈为何总报错啊?Exception in thread "Timer-3" com.jfinal.plugin.activerecord.ActiveRecordException: java.sql.SQLException: com.mchange.v2.c3p0.ComboPooledDataSource [ java.beans.IntrospectionException: java.lang.reflect.InvocationTargetException [numThreadsAwaitingCheckoutDefaultUser] ] has been closed() -- you can no longer use it.
    at com.jfinal.plugin.activerecord.Model.find(Model.java:424)
    at com.jfinal.plugin.activerecord.Model.findFirst(Model.java:462)
    at com.hikvision.sys.config.ParaConfigService.findByKey(ParaConfigService.java:28)
    at com.hikvision.sys.config.ParaConfigService.getValueByKey(ParaConfigService.java:36)
    at com.hikvision.recordTemplate.TimeComputer.getRateFromDb(TimeComputer.java:44)
    at com.hikvision.timer.TaskTimer$1.run(TaskTimer.java:63)
    at java.util.TimerThread.mainLoop(Unknown Source)
    at java.util.TimerThread.run(Unknown Source)
Caused by: java.sql.SQLException: com.mchange.v2.c3p0.ComboPooledDataSource [ java.beans.IntrospectionException: java.lang.reflect.InvocationTargetException [numThreadsAwaitingCheckoutDefaultUser] ] has been closed() -- you can no longer use it.
    at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.assertCpds(AbstractPoolBackedDataSource.java:447)
    at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getPoolManager(AbstractPoolBackedDataSource.java:459)
    at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:128)
    at com.jfinal.plugin.activerecord.DbKit.getConnection(DbKit.java:129)
    at com.jfinal.plugin.activerecord.Model.find(Model.java:421)
    ... 7 more

展开
收起
kun坤 2020-06-14 14:05:18 10985 0
1 条回答
写回答
取消 提交回答
  • 这个主要是连接池中连接有效时间和数据那边的连接 timeout 配置之间关系的问题。

    2021-02-26 14:03:44
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载