使用spring+mybatis在数据库增加一条信息时,出现了如下错误:
Logging initialized using 'class org.apache.ibatis.logging.stdout.StdOutImpl' adapter.
Creating a new SqlSession
SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@f6c03cb] was not registered for synchronization because synchronization is not active
最后发现时版本问题, 修改之前我的MySQL驱动版本是8.0.28
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.28</version>
druid版本是1.1.12
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>1.1.12</version>
最后把druid改为1.1.10就好了
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>1.1.10</version>