I believe what you're seeing is a delay due to automatic dirty checking, which occurs when you're issuing queries (QueryOver<Country>). When you use Session.Clear there is less data to dirty check, hence it's a lot faster. You can experiment by setting Session.FlushMode=FlushMode.Never, which would reduce the difference.
/G 2014-09-12 8:02 GMT+02:00 Marius Schröder <[email protected]>: > Please find enclosed the sample project. > > Am Mittwoch, 10. September 2014 17:42:33 UTC+2 schrieb Gunnar Liljas: >> >> Please do! >> >> 2014-09-10 7:49 GMT+02:00 Marius Schröder <[email protected]>: >> >> I can upload you a little sample Project, which can show the problem. >>> In my sample Project there you can have a sateless session, but this >>> sample project should imitate our greater project so we can't use a >>> stateless. Stateless can't use our user rights in the application. >>> >>> In the sample project, i'm opening the session, write Data in the two >>> tables and create from these data the reporting tablae. After all done, i >>> close the session. >>> >>> >>> Am Mittwoch, 10. September 2014 00:36:37 UTC+2 schrieb Gunnar Liljas: >>>> >>>> Can you describe: >>>> >>>> 1. How you are managing the sessions. When are they opened and when are >>>> they closed? >>>> 2. What problems you are experiencing with stateless sessions? >>>> >>>> 2014-09-09 13:27 GMT+02:00 Marius Schröder <[email protected]>: >>>> >>>>> Hello, >>>>> >>>>> thank you for your fast response. We thought and tested our program >>>>> with a stateless session, but we cant implement it. We have to use user >>>>> rights in our queries and thats the problem with the stateless. >>>>> >>>>> Am Dienstag, 9. September 2014 13:20:50 UTC+2 schrieb Ricardo Peres: >>>>> >>>>>> Why not use a stateless session instead (sessionFactory. >>>>>> OpenStatelessSession()) and do all your queries for reporting with >>>>>> it? >>>>>> This way, entities will not be kept in memory and no need to Clear() >>>>>> the session. >>>>>> >>>>>> RP >>>>>> >>>>>> On Tuesday, September 9, 2014 11:52:04 AM UTC+1, Marius Schröder >>>>>> wrote: >>>>>>> >>>>>>> Hello, >>>>>>> >>>>>>> I have a big performance issue in our program. >>>>>>> >>>>>>> Simplified: I have many tables in a database. >>>>>>> >>>>>>> Now I create some new tables from these data (Create Reportings). >>>>>>> >>>>>>> If I load the data (many datas) from the database for the >>>>>>> reportings, I have a big cache, and it takes a long time > 1h to >>>>>>> generate >>>>>>> these reportings... The memory consumption of the generation is also >>>>>>> very >>>>>>> high. >>>>>>> >>>>>>> If I place some "Session.Clear" into the program, after the >>>>>>> loadings, the time for the generation is a lot faster. Also the memory >>>>>>> is >>>>>>> smaller. >>>>>>> >>>>>>> *Normal* >>>>>>> >>>>>>> Time average: 1h 23min >>>>>>> Memory average: 230 MB >>>>>>> >>>>>>> *After the Change (Session.Clear)* >>>>>>> >>>>>>> Time average: 0h 25min >>>>>>> Memory average: 171 MB >>>>>>> >>>>>>> I compared the data in the database and they are the same. >>>>>>> >>>>>>> >>>>>>> I hope you understand the problem, and you can help me, why there is >>>>>>> such a big difference. >>>>>>> >>>>>>> Best Regards, >>>>>>> >>>>>>> M. Schröder >>>>>>> >>>>>> -- >>>>> 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. >>>>> For more options, visit https://groups.google.com/d/optout. >>>>> >>>> >>>> -- >>> 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. >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> -- > 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. > For more options, visit https://groups.google.com/d/optout. > -- 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. For more options, visit https://groups.google.com/d/optout.
