-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Description
MyBatis version
3.4.0
Database vendor and version
Any
Test case or example project
See CursorSimpleTest#testCursorWithRowBound.
Steps to reproduce
I added foreach processing for Cursor in test case as follow:
Cursor<User> usersCursor = sqlSession.selectCursor("getAllUsers", null, new RowBounds(1, 2));
for(User user: usersCursor) { // Add
System.out.println(user);
}Expected result
I expected print as follow:
User{id=2, name='User2'}
User{id=3, name='User3'}
Actual result
This code occurred the CursorException.
User{id=2, name='User2'}
org.apache.ibatis.cursor.CursorException: Cursor is closed
at org.apache.ibatis.cursor.defaults.DefaultCursor$CursorIterator.next(DefaultCursor.java:207)
at org.apache.ibatis.submitted.cursor_simple.CursorSimpleTest.testCursorWithRowBound2(CursorSimpleTest.java:169)
...
Related links
Metadata
Metadata
Assignees
Labels
No labels