[JAVA-451] About closing of cursors Created: 18/Oct/11 Updated: 11/Sep/19 Resolved: 22/Sep/16 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | API |
| Affects Version/s: | 2.6.5 |
| Fix Version/s: | None |
| Type: | Task | Priority: | Minor - P4 |
| Reporter: | Guy Boertje | Assignee: | Unassigned |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | cursor | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
jruby 1.6.4 |
||
| Description |
|
Given: a new cursor via a find on a collection Is this a bug? I expect that an exception should be thrown if one changes the sort or limit etc on a closed cursor. |
| Comments |
| Comment by Jeffrey Yemin [ 22/Sep/16 ] |
|
As DBCursor is effectively deprecated now, we don't plan to make any further changes in its behavior. The new CRUD API defined in MongoCollection does not suffer from this design issue. |
| Comment by Guy Boertje [ 18/Oct/11 ] |
|
Sorry I need to be less assuming. This is my understanding. When the cursor is created the private var _it is null. AFAIK the java tests dont cover this. In trying to make JMongo API compatible with the ruby driver which does have a test for this, the test failed. Now I know that this may be being over zealous of the ruby driver and I have to make a judgement call on whether to stick hard an fast to the API or skip the test. It seems weird, in the case described above, to be able to use the cursor after it been closed, or maybe I am missing something. |
| Comment by Antoine Girbal [ 18/Oct/11 ] |
|
In any case no documents can be fetched anymore. |