Java Interview Crash Guide
Mar 18, 2022 · Databases
Mastering MyBatis Streaming Queries: Keep Connections Open and Avoid Cursor Errors
Streaming queries return an iterator instead of a full result set, reducing memory usage, but require the database connection to stay open; this guide explains MyBatis’s Cursor interface, its methods, common pitfalls like premature closure, and three practical solutions using SqlSessionFactory, TransactionTemplate, or @Transactional to ensure reliable streaming.
CursorJavaMyBatis
0 likes · 6 min read
