SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@1fa5519] was not registered for synchronization because synchronization is not active
Creating a new SqlSession
SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@1fa5519] was not registered for synchronization because synchronization is not active
开发环境:Spring4.3.6 + MyBatis3.4.2 + MySQL5.7
抛出这个提示,不明就里,不知道哪里出现了异常,但是执行到 MyBatis 的 UserDao 中的 saveUser 方法时比较慢,于是将此段代码 try{}catch(),报出如下异常:
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:
### Error updating database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is com.alibaba.druid.pool.DataSourceDisableException
### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is com.alibaba.druid.pool.DataSourceDisableException
这就明确了问题的症结,是由于 com.alibaba.druid 连接池引起的,由于之前项目中用的 Spring 版本是 3.x 的,本项目用的是 Spring4.x 的,故推测 druid 版本问题,于是将 druid 的版本由 0.2.26 升级为 0.2.26 解决了此问题。
最新文章
- 【精粹系列】PHP精粹
- 学习笔记:HTML5 Canvas绘制简单图形
- Qt环境搭建(Qt Creator)+Visual Studio
- PHP 的 HMAC_SHA1算法 实现
- urllib2中自定义opener
- Swift学习笔记四
- Css3动态伪类
- cocos2d-x 移植android竖,横屏设置
- JUC学习笔记--JUC中并发工具类
- 转:简单的Mysql主从复制设置
- shell 中最常使用的 FD (file descriptor)
- 201521123044 《Java程序设计》第5周学习总结
- Robots.txt - 禁止爬虫
- POJ-1122 FDNY to the Rescue!---Dijkstra+反向建图
- CSS3左右间歇晃动效果
- Ubuntu16.04中php如何切换版本
- 图灵一代接入V1
- python代码检索小引擎
- Redis 发布与订阅 消息
- [寒假学习笔记](一)Markdown语法学习