[JAVA-1846] OperationIterable.forEach/first should close the MongoCursor in a finally block Created: 28/May/15 Updated: 16/Jul/15 Resolved: 29/May/15 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Query Operations |
| Affects Version/s: | 3.0.0, 3.0.2 |
| Fix Version/s: | 3.0.3, 3.1.0 |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Jeffrey Yemin | Assignee: | Jeffrey Yemin |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
OperationIterable.forEach and OperationIterable.first could leave the cursor open in the face of an exception thrown from Block.apply. It should ensure that the cursor is closed in a finally block |
| Comments |
| Comment by Jeffrey Yemin [ 16/Jul/15 ] |
|
Fix is now available in the 3.0.3 release. |
| Comment by Githook User [ 29/May/15 ] |
|
Author: {u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}Message: Closing MongoCursor in a finally block in OperationIterable.first and OperationIterable.forEach, to protect against exceptions. |
| Comment by Githook User [ 29/May/15 ] |
|
Author: {u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}Message: Closing MongoCursor in a finally block in OperationIterable.first and OperationIterable.forEach, to protect against exceptions. |
| Comment by Jeffrey Yemin [ 28/May/15 ] |
|
https://github.com/jyemin/mongo-java-driver/pull/25 Noticed this while looking at http://stackoverflow.com/questions/30424894/java-syntax-with-mongodb. |