Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I have a database that generates a query result array, each position of the array being a hash like object.

Since each array item must be mapped into a well defined class, I decided to implement an array-adapter that cast every item into the expected object class. This cast is done only upon request, not in advance.

The native query only return ids. The adapter uses these to pull the object that must be adapted. This approach introduces a time delay between the query (native query result) and the provided final item. During this time any item could have been modified in the background by other process. There is also an ugly effect where different sections of the array have different eventual consistency.

Does this mean that any database query must be exhaustive (no lazy fetch of results)?

If a query should always be exhaustive, I am considering in making my adapter smarter, capable of performing a limited query for my views. If the view request a point past the initial limit, it will load more results, however this seems to have the same consistency by parts problems as before.

How are the problems for lazy loading of past query results consistency problems solved?

share|improve this question
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.