JavaDoc for DBCursor says that results are lazy-fetching from the database. But
public class DBApiLayer extends DB {
...
private void init( Response res ){
...
_cur = res.iterator()
...
}
Iterator<DBObject> _cur;
...
}
contains all items that match the query (and they take heap as I understand it). And concurrent db.collection.update(...) doesn't change those objects. Is storing all objects in heap thread safe implementation?
Please explain me what does 'lazy' and 'thread safe' mean in this case.