为提高效率,提问时请提供以下信息,问题描述清晰可优先响应。
【DM版本】:8.
【操作系统】:麒麟V10 (X86)
【CPU】:X86
【问题描述】*:
以下SQL执行时间在管理控制器是3.6秒,报以下错别(其他SQL执行正常),请问怎么处理?
======= Sql Logger ======================
select count(*) as total from v_ph_dj_nsrxx_h where (nsrmc like '%abb%' or shxydm like '%abb%') and swjg_dm like '310%'
======= Sql Execute Time: 10.015s =======
2023-11-15 10:46:57.300 DEBUG 1 --- [ XNIO-1 task-5] org.mybatis.spring.SqlSessionUtils :49 : Releasing transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@168ee86d]
2023-11-15 10:46:57.301 DEBUG 1 --- [ XNIO-1 task-5] org.mybatis.spring.SqlSessionUtils :49 : Transaction synchronization deregistering SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@168ee86d]
2023-11-15 10:46:57.301 DEBUG 1 --- [ XNIO-1 task-5] org.mybatis.spring.SqlSessionUtils :49 : Transaction synchronization closing SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@168ee86d]
2023-11-15 10:46:57.312 ERROR 1 --- [ XNIO-1 task-5] c.k.t.c.s.h.GlobalBizExceptionHandler :54 : 全局异常信息 ex=
; uncategorized SQLException; SQL state []; error code [20000]; Connection has been switched; nested exception is dm.jdbc.driver.DMException: Connection has been switched
org.springframework.jdbc.UncategorizedSQLException:
; uncategorized SQLException; SQL state []; error code [20000]; Connection has been switched; nested exception is dm.jdbc.driver.DMException: Connection has been switched
at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:93) ~[mybatis-spring-2.1.1.jar!/:2.1.1]
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:439) ~[mybatis-spring-2.1.1.jar!/:2.1.1]
at com.sun.proxy.$Proxy181.selectList(Unknown Source) ~[na:na]
at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:224) ~[mybatis-spring-2.1.1.jar!/:2.1.1]
at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.executeForMany(MybatisMapperMethod.java:166) ~[mybatis-plus-core-3.5.3.2.jar!/:3.5.3.2]
at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:77) ~[mybatis-plus-core-3.5.3.2.jar!/:3.5.3.2]
at com.baomidou.mybatisplus.core.override.MybatisMapperProxy$PlainMethodInvoker.invoke(MybatisMapperProxy.java:148) ~[mybatis-plus-core-3.5.3.2.jar!/:3.5.3.2]
at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:89) ~[mybatis-plus-core-3.5.3.2.jar!/:3.5.3.2]
at com.sun.proxy.$Proxy251.selectList(Unknown Source) ~[na:na]
at com.baomidou.mybatisplus.core.mapper.BaseMapper.selectPage(BaseMapper.java:272) ~[mybatis-plus-core-3.5.3.2.jar!/:3.5.3.2]
at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627) ~[na:1.8.0_202]
at com.baomidou.mybatisplus.core.override.MybatisMapperProxy$DefaultMethodInvoker.invoke(MybatisMapperProxy.java:162) ~[mybatis-plus-core-3.5.3.2.jar!/:3.5.3.2]
at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:89) ~[mybatis-plus-core-3.5.3.2.jar!/:3.5.3.2]
at com.sun.proxy.$Proxy251.selectPage(Unknown Source) ~[na:na]
at com.baomidou.mybatisplus.extension.service.IService.page(IService.java:448) ~[mybatis-plus-extension-3.5.3.2.jar!/:3.5.3.2]
at com.knowdt.tba.tba.service.impl.VPhDjNsrxxHServiceImpl.getCompanyList(VPhDjNsrxxHServiceImpl.java:72) ~[classes!/:na]
at com.knowdt.tba.tba.service.impl.VPhDjNsrxxHServiceImpl$$FastClassBySpringCGLIB$$976c6d3f.invoke(<generated>) ~[classes!/:na]
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.3.29.jar!/:5.3.29]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:793) ~[spring-aop-5.3.29.jar!/:5.3.29]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.3.29.jar!/:5.3.29]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763) ~[spring-aop-5.3.29.jar!/:5.3.29]
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123) ~[spring-tx-5.3.29.jar!/:5.3.29]
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388) ~[spring-tx-5.3.29.jar!/:5.3.29]
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119) ~[spring-tx-5.3.29.jar!/:5.3.29]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.29.jar!/:5.3.29]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763) ~[spring-aop-5.3.29.jar!/:5.3.29]
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:708) ~[spring-aop-5.3.29.jar!/:5.3.29]
at com.knowdt.tba.tba.service.impl.VPhDjNsrxxHServiceImpl$$EnhancerBySpringCGLIB$$edd94fbd.getCompanyList(<generated>) ~[classes!/:na]
at com.knowdt.tba.tba.controller.IndexController.getCompanyList(IndexController.java:83) ~[classes!/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_202]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_202]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_202]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_202]
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) ~[spring-web-5.3.29.jar!/:5.3.29]
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150) ~[spring-web-5.3.29.jar!/:5.3.29]
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117) ~[spring-webmvc-5.3.29.jar!/:5.3.29]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895) ~[spring-webmvc-5.3.29.jar!/:5.3.29]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808) ~[spring-webmvc-5.3.29.jar!/:5.3.29]
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.3.29.jar!/:5.3.29]
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1072) ~[spring-webmvc-5.3.29.jar!/:5.3.29]
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:965) ~[spring-webmvc-5.3.29.jar!/:5.3.29]
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) ~[spring-webmvc-5.3.29.jar!/:5.3.29]
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909) ~[spring-webmvc-5.3.29.jar!/:5.3.29]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:517) [jakarta.servlet-api-4.0.4.jar!/:4.0.4]
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) ~[spring-webmvc-5.3.29.jar!/:5.3.29]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:584) [jakarta.servlet-api-4.0.4.jar!/:4.0.4]
at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74) [undertow-servlet-2.2.26.Final.jar!/:2.2.26.Final]
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129) [undertow-servlet-2.2.26.Final.jar!/:2.2.26.Final]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:337) [spring-security-web-5.7.10.jar!/:5.7.10]
at org.springframework.security.web.access.intercept.AuthorizationFilter.doFilter(AuthorizationFilter.java:96) [spring-security-web-5.7.10.jar!/:5.7.10]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) [spring-security-web-5.7.10.jar!/:5.7.10]
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:122) [spring-security-web-5.7.10.jar!/:5.7.10]
解决了吗,老哥,我这儿也遇到这个问题哦
请参考https://eco.dameng.com/community/question/71bfe92666dcb9499921ccb984348b25
是集群吗?
请补充环境说明。