关于connection holder is null的个人解决方案实践
由于公司需要标准化项目,规范jdk,tomcat等version,
版本规范:6.x --> 7.0.90
版本规范:jdk1.6.x -- >jdk1.8.0_181
版本规范:spring3.x -- >spring-4.3.7
项目中使用了hibernate3.x,和规范后的jdk1.8不兼容,导致需要升级hibernate的版本,目前升级版本至
<groupId>org.hibernate</groupId><artifactId>hibernate-core</artifactId>
<version>4.3.11.Final</version>
升级hibernate后导致了一系列的异常,其中connection holder is null这个问题为提交事务的时候抛出来的
从网上得知的解决方案:
https://blog.csdn.net/wo8553456/article/details/40396401
插入后跟进源代码发现配置已生效,然而hibernate提交事务的时候一样会报错(项目中使用的是声明式注解事务)
找了好久没搞定求助架构大佬后大佬指出,hibernate3中的配置connection.release_mode在hibernate4中会导致连接直接被关闭
源代码跟进见 https://blog.csdn.net/ayanami001/article/details/48181243
跟进源代码见下:
进入下面这个 this.getLogicalConnection().releaseConnection()后.连接就会被释放掉(提交事务逻辑里面),导致最终提交事务事连接为null抛出 connection holder is null 异常!
最终在hibernate的配置中去除了<prop key="hibernate.connection.release_mode">after_statement</prop>后,事务提交正常!
ps:其他hibernate异常或者tomcat改造异常见下面连接
本次改造升级的问题点
关于connection holder is null的个人解决方案实践相关推荐
- 已解决:connection holder is null问题。
错误信息 Caused by: java.sql.SQLException: connection holder is null at com.alibaba.druid.pool.DruidPool ...
- java.sql.SQLException: connection holder is null
解决方案一: <!-- 是否自动回收超时连接 --> <property name="removeAbandoned" value="true" ...
- connection holder is null
1 连接被回收 (1)错误日志 Caused by: java.sql.SQLException: connection holder is null at com.alibaba.druid.poo ...
- 使用Druid数据源时候这个问题碰到过没:connection holder is null
点击上方蓝色"程序猿DD",选择"设为星标" 回复"资源"获取独家整理的学习资料! 来源 | https://www.jianshu.com ...
- java holder_java.sql.SQLException: connection holder is null
错误信息 2017-11-15 14:53:16.931 [ ] ERROR com.hzcf.flagship.web.AssetPlanController 126 : ### Error upd ...
- 关于报错connection holder is null
关于报错connection holder is null 在练习使用jsp过程中 package com.cjh.dao.impl;import com.cjh.pojo.User; import ...
- java数据库连接Druidsql失败_Druid数据库连接池异常connection holder is null
Druid数据库连接池异常connection holder is null 具体如下:### Error updating database. Cause: java.sql.SQLExcepti ...
- Druid java.sql.SQLException: connection holder is null
问题 java.sql.SQLException: connection holder is null 项目使用了Druid,执行过程中出现了这个错误. 解决过程 错误的意思是没有获取到连接,怀疑是同 ...
- 线上问题:java.sql.SQLException: connection holder is null
1 场景复现 定时更新MySQL数据到缓存中:Map存储. A表和B表均在一个定时任务中查询数据,A表先查,B表后查, B表查询时,出现java.sql.SQLException: connectio ...
最新文章
- 100个必会的python脚本-学会这个Python库,至少能减少100行代码
- python_ re模块学习
- 解决 sessionStroage 无法在多个标签页共享数据的问题
- 全球最大编程问答社区 Stack Overflow 宣布裁员 15%!
- python 多分类 recall_sklearn多分类问题
- android x5 webview 第一次,android:X5WebView 首次初始化 X5 内核耗时, 会产生卡顿现象的解决办法...
- django——三种方式实现文件下载
- 如何管理好技术团队的十六点建议
- DIOCP之DEMO-登陆验证设计(二)
- 【项目实训】实验八 数据处理
- 翻译 Duckietown an Open, Inexpensive and Flexible Platform for Autonomy Education and Research
- 沃尔玛中国将采用唯链雷神区块链追踪食品供应链
- Echarts (option.yAxis) Y轴 的属性
- storm DRPC例子
- H3C设备的基本配置
- 如何查看自己的公网ip
- intent.setComponent()方法
- 2021最新版本Python的下载安装及使用入门教程
- 在局域网下怎样控制另一台电脑
- kl变换简单的解释入门_2010年20个最佳入门指南解释者主题
热门文章
- linux无线网卡连接不稳定怎么办,无线网络信号不稳定的四种原因及解决方法
- PAT(B) 1037 在霍格沃茨找零钱(Java)
- xp重启无线网络服务器,XP系统怎样重置网络命令|XP系统快速重置网络命令的方法...
- 行测——资料分析——百分点,年均增长,拉动增长
- CS224n NLP-Lecture 2: Word Vectors/第二讲-词向量表示: word2vec
- 学霸们挤破头都想去的公司,这些“香饽饽”人工智能企业你知道吗?
- Android privilege escalation to mediaserver from zero permissions (CVE-2014-7920 + CVE-2014-7921)
- 【复习回顾、继承、抽象类、模板设计模式】
- 未来10年哪个国家最有“钱”途?普华永道全球AI研究报告发布
- 论文笔记: Black Re-ID 黑衣人重识别