Spring Boot Mybatis 出现 was not registered for synchronization because synchronization is not active

今天在修改代码的时候发现有个提示 was not registered for synchronization because synchronization is not active

http://img.runbrick.com/blog/2020112401.png

这是因为在 @Service 中没有写 @Transactional 写了之后就不会出现这个提示了。

http://img.runbrick.com/blog/2020112402.png

不过 @Transactional 还是要注意一下,按需求添加。

# Java 

评论

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×