
springboot项目突然报错:sqlsession 未注册同步
在运行良好的 springboot 项目中,突然出现了如下错误:
creating a new sqlsession sqlsession [org.apache.ibatis.session.defaults.defaultsqlsession@2dbe837b] was not registered for synchronization because synchronization is not active
该错误并非源自代码修改,而是无故突发。项目配置文件如下:
server:
port: 8080
spring:
datasource:
druid:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://110.35.20.7:3306/cos?useUnicode=true&characterEncoding=utf8&autoReconnect=true&allowMultiQueries=true&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=Asia/Shanghai
username: mes_it
password: 123456
mybatis-plus:
config-location: classpath:mybatis/mybatis-config.xml
mapper-locations: classpath:mybatis/mapper/*.xml解决办法:
根据错误提示,该问题可能与 mybatis 中的同步机制有关。如果您启用了 mybatis 的同步机制,需要检查其配置并确保其正常工作。
另外,您还可以尝试以下操作:
如果上述方法无法解决问题,建议您查看这篇博文:
https://blog.csdn.net/web1829...
以上就是SpringBoot 项目突然报错:SqlSession 未注册同步,如何解决?的详细内容,更多请关注php中文网其它相关文章!
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号