Maximilian, I read the article by Ayende and (as always) it is really, really, really interesting. Exploiting the described hack it is possible to have:
- reader-like, performing, data streaming - first level cache inactivity (by using stateless session) - hydration naturally managed through NHibernate (so, no need to write unmantainable mapping code between reader and entities) Actually, it is definitely what I needed. Thanks a lot, Marcello. Il giorno venerdì 22 febbraio 2013 14:14:56 UTC+1, Maximilian Haru Raditya ha scritto: > > Hmm... I'm not aware if NH could actually do data streaming like that. > There's an old post by Ayende here about streaming large result sets: > http://ayende.com/blog/4548/nhibernate-streaming-large-result-sets, it > uses IQuery.List(IList results). I've tried it earlier, but I can't > actually verify whether it actually stream data or not (I wonder how I'm > supposed to verify it). And I wonder whether IQueryOver<T>.Future() would > actually perform data streaming like data reader does... :D > > > > The NHibernate interface > > session.QueryOver<MyEntity>().Future(); > > which gives IEnumerable<MyEntity>() would be perfect for the objective. > > The problem is that Future() does not work on stateless sessions and > stateful sessions cannot be used in this case (more than 10 millions of > records). > > It seems, at least in the IntelliSense level, > statelessSession.QueryOver<MyEntity>().Future() would show up. So I'm not > sure what you meant by it doesn't work on stateless sessions. > > > > > > > > > On Fri, Feb 22, 2013 at 2:30 PM, Marcello Esposito > <[email protected]<javascript:> > > wrote: > >> Yes. >> >> The NHibernate interface >> >> session.QueryOver<MyEntity>().Future(); >> >> which gives IEnumerable<MyEntity>() would be perfect for the objective. >> The problem is that Future() does not work on stateless sessions and >> stateful sessions cannot be used in this case (more than 10 millions of >> records). >> So, reader-like streaming would be desired. >> >> Thanks, >> Marcello. >> >> Il giorno giovedì 21 febbraio 2013 10:11:30 UTC+1, Maximilian Haru >> Raditya ha scritto: >>> >>> What do you mean by "trying a stateless session with Enumerables"? >>> Do you mean "streaming data" using NHibernate like using DataReader? >>> >>> >>> On Wed, Feb 20, 2013 at 11:06 PM, Marcello Esposito < >>> [email protected]> wrote: >>> >>>> Hi all. >>>> >>>> I have to read all records in a big table (more than 10 millions of >>>> records) for indexing purposes (Lucene.Net involved). >>>> In order to assure good performance and prevent memory overloads, I was >>>> trying a Stateless Session with Enumerables (not Lists), but I realized >>>> that .Future() doesn't work on stateless sessions and didn't find another >>>> way to get a IEnumerable. >>>> >>>> Any help? >>>> >>>> Thanks, >>>> Marcello. >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "nhusers" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to nhusers+u...@**googlegroups.com. >>>> To post to this group, send email to [email protected]. >>>> >>>> Visit this group at >>>> http://groups.google.com/**group/nhusers?hl=en<http://groups.google.com/group/nhusers?hl=en> >>>> . >>>> For more options, visit >>>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out> >>>> . >>>> >>>> >>>> >>> >>> >>> >>> -- >>> Regards, >>> >>> Maximilian Haru Raditya >>> >> -- >> You received this message because you are subscribed to the Google Groups >> "nhusers" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> To post to this group, send email to [email protected]<javascript:> >> . >> Visit this group at http://groups.google.com/group/nhusers?hl=en. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > > > > -- > Regards, > > Maximilian Haru Raditya > -- You received this message because you are subscribed to the Google Groups "nhusers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/nhusers?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
