首页 > 数据库 >ERROR [org.hibernate.transaction.JDBCTransaction] - Could not toggle autocommit java.sql.SQLExceptio

ERROR [org.hibernate.transaction.JDBCTransaction] - Could not toggle autocommit java.sql.SQLExceptio

时间:2024-10-12 17:21:51浏览次数:7  
标签:autocommit transaction java driver springframework SQLStateMapping org DatabaseE

错误描述:

 DEBUG [org.hibernate.SQL] - SELECT orp.ATTR6 FROM DISTRIBUT_VIEW d 

WHERE d.state = '1' AND d.oper_log LIKE '%下单%' 

GROUP BY orp.ATTR6
 ERROR [org.hibernate.transaction.JDBCTransaction] - Could not toggle autocommit
java.sql.SQLException: 关闭的连接
at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)
at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:112)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:173)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:229)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:403)
at oracle.jdbc.driver.PhysicalConnection.setAutoCommit(PhysicalConnection.java:3229)
at org.apache.commons.dbcp.DelegatingConnection.setAutoCommit(DelegatingConnection.java:371)
at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.setAutoCommit(PoolingDataSource.java:328)
at org.hibernate.transaction.JDBCTransaction.toggleAutoCommit(JDBCTransaction.java:194)
at org.hibernate.transaction.JDBCTransaction.commitAndResetAutoCommit(JDBCTransaction.java:142)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:115)
at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:578)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:662)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:632)
at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:314)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:117)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at com.sun.proxy.$Proxy413.addTotalDeliveryGoodsByArea(Unknown Source)
at com.titan.action.manager.task.TotalDeliveryGoodsTaskJob.timedReset(TotalDeliveryGoodsTaskJob.java:15)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:273)
at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:272)
at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:529)
2024-09-24 11:42:47,334 ERROR [org.hibernate.transaction.JDBCTransaction] - JDBC commit failed
java.sql.SQLRecoverableException: Io 异常: Socket read timed out
at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:101)
at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:112)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:173)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:229)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:458)
at oracle.jdbc.driver.T4CConnection.doCommit(T4CConnection.java:582)
at oracle.jdbc.driver.PhysicalConnection.commit(PhysicalConnection.java:3351)
at oracle.jdbc.driver.PhysicalConnection.commit(PhysicalConnection.java:3357)
at org.apache.commons.dbcp.DelegatingConnection.commit(DelegatingConnection.java:334)
at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.commit(PoolingDataSource.java:211)
at org.hibernate.transaction.JDBCTransaction.commitAndResetAutoCommit(JDBCTransaction.java:139)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:115)
at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:578)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:662)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:632)
at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:314)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:117)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at com.sun.proxy.$Proxy413.addTotalDeliveryGoodsByArea(Unknown Source)
at com.titan.action.manager.task.TotalDeliveryGoodsTaskJob.timedReset(TotalDeliveryGoodsTaskJob.java:15)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:273)
at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:272)
at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:529)
2024-09-24 11:42:47,334 ERROR [org.hibernate.util.JDBCExceptionReporter] - Already closed.
2024-09-24 11:42:47,335 ERROR [org.hibernate.util.JDBCExceptionReporter] - Already closed.

问题原因:sql查询时间过长。

解决方案:优化sql.

标签:autocommit,transaction,java,driver,springframework,SQLStateMapping,org,DatabaseE
From: https://www.cnblogs.com/mingyangli/p/18460982

相关文章

  • SpringBoot2.x 版本集成elasticsearch 8.x(基于elasticsearch-java)
    上次elasticsearch到8.13.3之后,由于springboot版本2.4.13,jdk版本是11,使用springboot内置的ElasticsearchRestTemplate查询的时候做了兼容性之后虽然代码没有报错了,但是每次查询都会有一个警告[WRAN],如果查询比较频繁的时候日志里面看到的全都是这种警告信息:[ignore_throttle......
  • javase基础(自用)
    常用的dos命令#查看当前目录下的所有文件dir#切换目录cdchangedirectorycd..#清理屏幕cls(clearscreen)#退出终端exit#查看电脑IPipconfg#打开应用 calc mspaint notepad#ping命令 pingwww.baidu.com #文件操作 md目录名 rd目录名 cd>文件名 de......
  • java获取当前时间(年月日)
     转自:https://blog.csdn.net/lynn_Kun/article/details/76997856 在java程序中常常需要获取的时间和设置时间的格式1、获取当前的时间Datedate=newDate();//此时date为当前的时间2、设置时间的格式Datedate=newDate();//此时date为当前的时间System.out.println(date);......
  • java.lang.UnsupportedOperationException: null
    问题描述:在Java中,当你遇到 java.lang.UnsupportedOperationException 这个异常时,通常意味着你尝试在一个不支持该操作的集合上执行了一个操作。在这个具体的例子中,问题很可能出在 toList() 方法的使用上,以及后续对列表的修改。List<Long>ids=dtos.stream(......
  • 前后端分离nodejs_vue+javascript个人身体健康档案管理系统
    目录技术栈具体实现截图开发工具和技术简介错误处理和异常处理nodejs类核心代码部分展示解决的思路其他题目推荐源码获取/联系我技术栈该系统将采用B/S结构模式,开发软件有很多种可以用,本次开发用到的软件是vscode,用到的数据库是MySQL,为了更加便捷地使用数据库,用到了......
  • JavaScript原型链污染漏洞分析
    原型链污染漏洞CVE:1、yargs-Parser输入验证错误漏洞(CVE-2020-7608)2、tough-cookie安全漏洞(CVE-2023-26136)3、JSON5原型污染漏洞(CVE-2022-46175) 漏洞描述:1、yargs-Parser输入验证错误漏洞(CVE-2020-7608):yargs-parser是一款选项解析器。yargs-parser13.1.2之前......
  • java 网络知识 + 多线程问题
    服务器:packagep1007;importjava.io.*;importjava.net.*;importjava.util.Random;publicclassServer{publicstaticvoidmain(String[]args){intport=12345;//服务端口try(ServerSocketserverSocket=newServerSocket(port)......
  • java 文件的建立,文件夹的建立, 删除
    importjava.io.File;importjava.io.IOException;publicclassFileTest{publicstaticvoidmain(String[]args)throwsIOException{//请在Begin-End间编写完整代码/**********Begin**********///创建目录Filefile=n......
  • JavaScript
    什么是JavaScript?Web标准也称为网页标准,由一系列的标准组成,大部分由W3C(WorldWideWebConsortium,万维网联盟)负责制定。三个组成部分:HTML:负责网页的基本结构(页面元素和内容)。CSS:负责网页的表现效果(页面元素的外观、位置等页面样式,如:颜色、大小等)。JavaScript:负责网页的......
  • PTA 作业六 JAVA 面向对象程序设计6-2 sdut-oop-list-1 学生集合(类、集合)作者 周雪芹
    6-2sdut-oop-list-1学生集合(类、集合)分数15作者 周雪芹单位 山东理工大学以下程序不完整,请你根据已经给出的程序代码中表达的题意,以及程序的输入、输出信息,完成Student类的设计,补全代码。函数接口定义:classStudent{}裁判测试程序样例:importjava.util.ArrayLi......