How to Eager Load Associations without duplication in NHibernate?

后端 未结 2 513
野的像风
野的像风 2020-11-22 08:01

I\'d need to load a list of very large objects with so many children and children of children. what\'s the best approach to take?

I\'m using Oracle 11g database and

2条回答
  •  不知归路
    2020-11-22 08:56

    I concur with @RadimKöhler as soon as you eager load more than one collection then a Cartesian product always occurs. For selecting a suitable batch size then I would probably choose this to be the same as the page size as it just feels right... (no evidence why though)

    There is another technique that you may feel is a better fit and that is to read this blog post by Ayende which shows you how you can send two future queries at the same time to eager load multiple collections that soul job is to load each collection singly.

    However whichever route you take I suggest throwing a profiler at the results to see which performs better for you...

提交回复
热议问题