marcal wrote:
Have you looked at ISession/IQuery/ICriteria.Enumerable()? See,
http://www.hibernate.org/hib_docs/nhibe ... a-querying , starting at the paragraph that begins "If you expect your query to return a very large number of objects..."
I don't think it is suited for me. The Enumerable() method first does a "light" request for getting the identifiers only. Then, when doing "foreach", you submit another request for each loop. So, if you fetch the entire collection, which is my case, you do n+1 select. It would slow a lot the UI. I would like to do only one request, as I know I need all the rows.
MisterTom_ wrote:
Maybe you could use pagination to fetch blocks of data in one thread and load them into the UI in an other thread.
you need a class to synchronise your threads with a queue and maybe a few flags (IsFinished, IsSuccess). Thread A would put load data block per block (with pagination) and put them in the queue and thread B would read the blocks from the queue and load them in the UI.
But do this only if you have a lot of data, and if you have too much data maybe you need to rethink your UI..."
Thanks for the tips, but if I understand well, I would need to send one request for each block. It's not possible for my case.