[JAVA-664] Use of DBCursor#iterator method can cause a leak of server-side cursor Created: 11/Oct/12 Updated: 26/Nov/13 Resolved: 26/Nov/13 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | API |
| Affects Version/s: | 2.9.0 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Jeffrey Yemin | Assignee: | Unassigned |
| Resolution: | Won't Fix | Votes: | 2 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
DBCursor#iterator is implemented to return a copy of "this":
So if you have code like:
The server-side cursor will not be killed, because the DBCursor that is being closed in the finally block is not the DBCursor that has the the cursor id. |
| Comments |
| Comment by Jeffrey Yemin [ 26/Nov/13 ] |
|
This will be fixed by design with a new cursor API, but this is a design error in the current API and is not really possible to fix properly without breaking compatibility. |