看下面配置中 数据库连接池的配置 说明,重点关注红色部分
server:
  port: 9013
spring:
  application:
    name: api
  datasource:
    druid:
      #数据库连接1
      mysql:
        name: mysql
        type: com.alibaba.druid.pool.DruidDataSource
        driver-class-name: com.mysql.jdbc.Driver
        url: jdbc:mysql://localhost:3306/datacube?useUnicode=true&characterEncoding=utf8&useSSL=false
        username: root
        password: rootrot
      #数据库连接2
      greenplum:
        name: greenplum
        type: com.alibaba.druid.pool.DruidDataSource
        driver-class-name: org.postgresql.Driver
        url: jdbc:postgresql://localhost:5432/datacube?useUnicode=true&characterEncoding=utf8&useSSL=false
        username: root
        password: rootroot
 
 
    # 下面为连接池的补充设置,应用到上面所有数据源中
    # 初始化大小,最小,最大
      initialSize: 5
      minIdle: 10
      maxActive: 1000
      #配置获取连接等待超时的时间
      maxWait: 60000
      #配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
      timeBetweenEvictionRunsMillis: 60000
      #配置一个连接在池中最小生存的时间,单位是毫秒
      minEvictableIdleTimeMillis: 300000
      #验证连接是否有效。此参数必须设置为非空字符串,下面三项设置成true才能生效
      validationQuery: SELECT 1
      #指明连接是否被空闲连接回收器(如果有)进行检验.如果检测失败,则连接将被从池中去除.
      testWhileIdle: true
      #指明是否在从池中取出连接前进行检验,如果检验失败,则从池中去除连接并尝试取出另一个
      testOnBorrow: true
      #指明是否在归还到池中前进行检验
      testOnReturn: false
      #打开PSCache,并且指定每个连接上PSCache的大小
      poolPreparedStatements: true
      maxPoolPreparedStatementPerConnectionSize: 20
      #配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
      filters: stat,wall,log4j
      #通过connectProperties属性来打开mergeSql功能;慢SQL记录
      connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=1000;druid.stat.logSlowSql=true
      #合并多个DruidDataSource的监控数据
      useGlobalDataSourceStat: true
#      WebStatFilter:
#        exclusions: "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*"
#      stat-view-servlet:
#       login-username: admin
#       login-password: admin
 
 
jpa:
   database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
   show-sql: true
   hibernate:
     #dialect: org.hibernate.dialect.MySQL5Dialect
     ddl-auto: none
     naming:
      strategy: org.hibernate.cfg.ImprovedNamingStrategy

springboot 数据库连接出现的诡异bug No operations allowed after connection closed.相关推荐

  1. com.mysql.cj.exceptions.ConnectionIsClosedException: No operations allowed after connection closed.

    目录 一.功能背景 二.错误信息 三.相关代码 四.问题原因 四.解决办法 1.修改dbDriver 2.修改数据库配置 3.通过修改配置文件信息 一.功能背景 在SpringBoot项目中使用第三方 ...

  2. 数据源 No operations allowed after connection closed

    Spring提供了两个这样的数据源(都位于org.springframework.jdbc.datasource程序包里): DriverManagerDataSource:在每个连接请求时都新建一个 ...

  3. ConnectionIsClosedException: No operations allowed after connection closed

    最近生产上spring boot项目使用Hikari 数据源在一个用户信息查询操作数据库时总是报如题的错误.网上查看很多资料一直没有解决,但目前也没有什么好的办法,哪位大神给指导下. 报错信息如下: ...

  4. mysql No operations allowed after connection closed.Connection was implicitly closed due to underly

    转载原文地址:原文地址 在说这个错误之前先说明我的项目是通过Hibernate来进行数据库操作的 关于MySQL连接超时问题,估计很多人都遇到过:大致情形都是这样,开发测试时程序都是正常的,一到第二天 ...

  5. (No operations allowed after connection closed.).Possibly consider using a shorter maxLifetime value

    这两天碰到一个问题,在正常查询数据时,没有问题,但在使用多线程查询数据导出时,会报以下错误: 2020-05-21 08:40:36.639 WARN [charger-business,,,] 13 ...

  6. 今天项目报错: No operations allowed after connection closed

    今天项目报错: No operations allowed after connection closed 错误原因:MySQL服务器默认的"wait_timeout"是28800 ...

  7. No operations allowed after connection closed.Connection was implicitly clos,MySQL服务器无法链接;

    尝试1:检查防火墙状态:systemctl status firewalld 如打开,需确认服务器端口是否开放  lsof -i : 8080(8080为实际需替换端口):如未打开请移步尝试2: 尝试 ...

  8. No operations allowed after connection closed--转

    https://www.jianshu.com/p/1626d41572f2 Spring boot的单数据源配置比较简单,只需要在application.properties配置相关的jdbc连接的 ...

  9. mysql报错No operations allowed after statement closed

    mysql报错No operations allowed after statement closed 网上搜了很多,感觉都没什么作用,很多都是改等待时间,其实还有一个原因,可能是数据库锁住了,这种报 ...

最新文章

  1. 虚拟内存,虚拟地址空间,用户空间,内核空间
  2. jquery选择器玩得不6啊,只能慢慢写判断了,唉..........................
  3. C#把某个数组的一部分复制到另一个数组中的两种方法:Buffer.BlockCopy和Array.Copy...
  4. epson机器人编程 范例_2019年机器人盘点(IREX篇)
  5. python语言通过字典实现映射关系_mpython3丨字典的使用介绍
  6. 技术阻击疫情,开发者在行动
  7. CTS/APIO后文化课游记
  8. 3. 二进制中1的个数
  9. python语言基本语句例句-关于python:使用WordNet查找同义词,定义和例句
  10. Jenkins不同job之间传递参数
  11. axure 发布 主页_车队如何在黑鸟APP发布同城活动?教程来了!
  12. 演变与重塑----2014全球软件技术峰会感想
  13. Mysql 时间戳类型使用心得
  14. 使用rmmod无法卸载驱动,强制卸除的两种方法
  15. 【人工智能】人工智能如何影响社会经济:关于近期文献的一个综述
  16. mysql分组后查询条数_MySQL分组后,如何统计记录条数
  17. SpringBoot分布式项目实现Session共享
  18. 2022危险化学品经营单位主要负责人考试题模拟考试题库模拟考试平台操作
  19. 重磅丨FIL10月减产即将到来 2分钟了解FIL分配模型
  20. 【python】Flask-SQLAlchemy的Lost connection问题

热门文章

  1. JSP带有属性的自定义标签
  2. springboot微信信小程序授权登录代码
  3. FXDD存取款,1-5工作日能够到国内个人银行账户
  4. 在Raspberry Pi上安装ArchLinux
  5. #311. 边双连通图
  6. iOS 关于CUICatalog: Invalid asset name supplied:‘‘问题
  7. nuke全版本官方提供全系列快速下载通道
  8. vue + threejs 实现场景环境贴图,模型高光显示效果
  9. java判断集合为空工具_java中怎么判断集合是否为空
  10. emlog rss.php,Emlog工具箱