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 解决了此问题。

最新文章

  1. 【精粹系列】PHP精粹
  2. 学习笔记:HTML5 Canvas绘制简单图形
  3. Qt环境搭建(Qt Creator)+Visual Studio
  4. PHP 的 HMAC_SHA1算法 实现
  5. urllib2中自定义opener
  6. Swift学习笔记四
  7. Css3动态伪类
  8. cocos2d-x 移植android竖,横屏设置
  9. JUC学习笔记--JUC中并发工具类
  10. 转:简单的Mysql主从复制设置
  11. shell 中最常使用的 FD (file descriptor)
  12. 201521123044 《Java程序设计》第5周学习总结
  13. Robots.txt - 禁止爬虫
  14. POJ-1122 FDNY to the Rescue!---Dijkstra+反向建图
  15. CSS3左右间歇晃动效果
  16. Ubuntu16.04中php如何切换版本
  17. 图灵一代接入V1
  18. python代码检索小引擎
  19. Redis 发布与订阅 消息
  20. [寒假学习笔记](一)Markdown语法学习

热门文章

  1. AngularJs 指令 directive中link,controller 的区别
  2. Linq中DeferredLoadingEnabled,DataLoadOption的用法
  3. 小程序不在以下 request 合法域名列表中
  4. 安装gitlab-runner
  5. 数据结构4.3_字符串模式匹配——KMP算法详解
  6. 机器学习KNN实例之数字识别
  7. jupyter notebook初步使用
  8. Android MVP模式实现组件和业务逻辑分离
  9. Day03 知识点
  10. vmware虚拟机提示:无法将Ethernet0连接到虚拟网络vmnet02018-03-07