首页 > 其他分享 >记录连接数导致警报失效,连接池少问题

记录连接数导致警报失效,连接池少问题

时间:2024-05-22 10:30:37浏览次数:24  
标签:web java springframework 连接数 apache org ApplicationFilterChain 连接池 警报


处理方式:spring: datasource:maxActive:30改为1000

org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is java.sql.SQLTransientConnectionException: HikariPool-1 - Connection is not available, request timed out after 30000ms.
at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:309)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.startTransaction(AbstractPlatformTransactionManager.java:400)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:373)
at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:595)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:382)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:708)
at com.example.xsysub.web.serviceimpl.smokeFeel.HikvisionSmokeServiceImpl$$EnhancerBySpringCGLIB$$e0a9f94c.resolve(<generated>)
at com.example.xsysub.web.controller.smokeFeel.SmokeFeelController.acceptData(SmokeFeelController.java:90)
at sun.reflect.GeneratedMethodAccessor133.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1072)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:965)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:652)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.boot.web.servlet.support.ErrorPageFilter.doFilter(ErrorPageFilter.java:126)
at org.springframework.boot.web.servlet.support.ErrorPageFilter.access$000(ErrorPageFilter.java:64)
at org.springframework.boot.web.servlet.support.ErrorPageFilter$1.doFilterInternal(ErrorPageFilter.java:101)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
at org.springframework.boot.web.servlet.support.ErrorPageFilter.doFilter(ErrorPageFilter.java:119)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:201)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:544)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:364)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:616)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:831)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1629)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.sql.SQLTransientConnectionException: HikariPool-1 - Connection is not available, request timed out after 30000ms.
at com.zaxxer.hikari.pool.HikariPool.createTimeoutException(HikariPool.java:696)
at com.zaxxer.hikari.pool.HikariPool.getConnection(HikariPool.java:197)
at com.zaxxer.hikari.pool.HikariPool.getConnection(HikariPool.java:162)
at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:128)
at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:265)
... 66 common frames omitted

标签:web,java,springframework,连接数,apache,org,ApplicationFilterChain,连接池,警报
From: https://www.cnblogs.com/liaoenqi/p/18205667

相关文章

  • python 监控AIDA64 实现高温警报
    importwinreg,winsound,pyttsx3,os,functoolsengine=pyttsx3.init()engine.setProperty('volume',1)#设置音量(0到1之间)rate=engine.getProperty('rate')#设置语速engine.setProperty('rate',rate-50)voices=engine.getProperty('vo......
  • .net8 winform程序使用EntityFrameworkCore连接数据库
    在.NET8WinForms应用程序中使用EntityFramework(EF)Core,你需要按照以下步骤操作:1.添加EntityFrameworkCoreNuGet包。2.定义你的数据模型。3.创建数据库上下文(DbContext)。4.在数据库上下文中配置EntityFramework。5.使用EntityFrameworkCore的API来执行数据库操作。......
  • springboot的服务不需要连接数据库,如何保证正常启动
    记个小笔记@SpringBootApplication(exclude=DataSourceAutoConfiguration.class)是一个SpringBoot应用程序中用来排除特定自动配置类的注解,一般情况不需要使用数据库,取消这个自动配置即可;如果你这样做了,发现还是出现FailedtoconfigureaDataSource:'url'attributeisn......
  • 连接池设计与实现一——以Golang Http1.1为例
    0.前言连接池是一个非常重要的开发思想,如httpclient会构建连接池复用底层TCP连接,使用database/sql的使用也会有连接池的配置。那么代码底层是如何实现连接池的呢?这篇文档将以Golang语言为基础,分析http1.1连接池底层实现★注意:我们仅仅关注连接池设计思想、以及关键源码解读,......
  • 服务器减少TIME_WAIT连接数
    可使用命令netstat-n|awk'/^tcp/{++S[$NF]}END{for(ainS)printa,S[a]}'查看服务器端的等待连接数 化tcptimewait的操作可以参考下方:编辑内核文件/etc/sysctl.conf,加入以下内容:net.ipv4.tcp_syncookies=1表示开启SYNCookies。当出现SYN等待队列溢......
  • Python - 数据库连接池
    目录SQLite自定义连接池使用sqlalchemy创建连接池SQLite自定义连接池importsqlite3fromqueueimportQueueclassSQLiteConnectionPool:def__init__(self,db_path,max_connection=10):self.db_path=db_path#数据库文件路径self.max_c......
  • Redis连接池
    【一】Redis连接池的优点​ Redis连接池的存在主要是为了优化Redis客户端和Redis服务器之间的连接管理,提升性能和稳定性。具体而言,Redis连接池具有以下几个优点:提升响应速度:由于连接池中已经存在可用的连接,客户端可以快速获取连接并执行操作,而不需要等待新的连接建立过程。这......
  • openGauss 检查应用连接数
    检查应用连接数如果应用程序与数据库的连接数超过最大值,则新的连接无法建立。建议每天检查连接数,及时释放空闲的连接或者增加最大连接数。操作步骤以操作系统用户omm登录数据库主节点。使用如下命令连接数据库。gsql-dpostgres-p8000postgres为需要连接的数据库名......
  • 使用PowerDesigner连接数据库并反向工程生成所有表及关系
    配置对数据库的JDBC连接时,总是提示连接失败!也没有任何其他信息,查阅网上资料并实际验证,按如下步骤可以成功:1、因为PowerDesigner是32位的程序,需要使用x86-32位版本的JDK2、配置PowerDesigner-》Tools-》GeneralOptions-》variables ,配置jar、java等路径配置为32位JDK3、......
  • openGauss 查看数据库连接数
    查看数据库连接数背景信息当用户连接数达到上限后,无法建立新的连接。因此,当数据库管理员发现某用户无法连接到数据库时,需要查看是否连接数达到了上限。控制数据库连接的主要以下几种选项。全局的最大连接数:由运行参数max_connections指定。某用户的连接数:在创建用户时由CREAT......