macrozheng
Jun 13, 2025 · Backend Development
Why MyBatis-Plus saveBatch Triggers Unexpected Transaction Rollback and How to Fix It
This article explains a puzzling Spring Boot transaction rollback caused by MyBatis-Plus's saveBatch method, reproduces the error with nested @Transactional calls, analyzes why the rollback flag is set, and offers a practical workaround by replacing the framework batch operation with a custom mapper implementation.
BackendJavaMyBatis-Plus
0 likes · 6 min read