[JAVA-704] Java Driver caches indexes internally, which causes indexes if indexes are managed by multiple apps Created: 29/Nov/12 Updated: 30/Nov/12 Resolved: 30/Nov/12 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Oleg Krook | Assignee: | Unassigned |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Java Driver 2.8.0 |
||
| Issue Links: |
|
||||||||
| Description |
|
Java Driver caches index information when using DBCollection.ensureIndex method that makes it unusable if there are multiple apps managing indexing/db. DBCollection.createIndex on the other hand does not cache this information. The mongo console does not have the createIndex method, but instead it has ensureIndex. The behavior of the JS vs Java ensureIndex is expected to be the same. The caching behavior is not documented anywhere. In addition, adding this kind of functionality to a db driver does not make sense, as it should serve as a proxy between the applications and the database. The application can decide whether or not to cache such information. |
| Comments |
| Comment by Oleg Krook [ 30/Nov/12 ] |
|
Thanks, it makes sense. |
| Comment by Jeffrey Yemin [ 30/Nov/12 ] |
|
The reason I marked this as a duplicate is that I think all caching behavior for indices should be removed from the driver. |
| Comment by Oleg Krook [ 30/Nov/12 ] |
|
I do not think the defects are related. The ensureIndex is advocated to be used on the www.mongodb.com, however the caching behavior of it is not documented anywhere. I would consider this to be a documentation defect after I've learned the createIndex should have been used instead. |
| Comment by Jeffrey Yemin [ 30/Nov/12 ] |
|
This issue duplicates |
| Comment by Ian Whalen (Inactive) [ 29/Nov/12 ] |
|
from Steps To Reproduce:
|