That seems perfectly possible to me - just fire a bunch of queries and
load the objects.
Take a look at your lazy loading / proxy settings though - would be
pointless doing this preload work if all you're fetching is lazy proxy
objects.

Also, if you're complexity is caused by lots of interrelated tables on
the database side, it never hurts to do a quick review of your foreign
keys and see if there's
anywhere you can add some indexes to speed up the DB reads

On Mar 24, 4:34 pm, mr_miles <[email protected]> wrote:
> Hi,
>
> I'm using nhibernate in a web service, to retrieve some fairly
> complicated objects from the database.  As activity has grown, I've
> started using the level2 cache to keep performance up, as activity is
> mostly read and very little write.
>
> However, if we ever have to restart the service, the level2 cache is
> cleared, and performance is "bad" until it fills up enough to reach
> the steady state again.  This is because the objects being retrieved
> are to all intents and purposes randomly chosen from a very large set,
> so performance only becomes "good" once a large proportion of the
> objects have been retrieved.
>
> I'm wondering, is it possible to pre-populate the underlying data
> cache by bulk fetching the data from the database.  For example, by
> running one query at start up that reads in all the rows for a given
> table in one go, rather than doing it per-object?
>
> (nb I'm quite new to nhibernate, so apologies if this doesn't make
> sense - I got this far from docs and web tutorials)
>
> Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to