I have mapped the guilty data as a collection of components, property of a parent business entity (as its lifetime is tighly coupled to its container, and it has nice benefits when inserting and deleting the parent container). Would that mean I need to create an IInterceptor which would load/save/delete with ado.net the collection when the container entity is loaded/saved/deleted with nhibernate?
I must admit I lack of experience (junior engeneer here) and I do not know well how ado.net works in background. My collection can grow up to 6 millions items (rows), so if ado.netgenerates an insert by item, it would still make 6 million insert statements. How would ado.net be faster that nhibernate in this case? In addition to that wouldn't opening an extra ado.net connection on loading/saving/deleting be a bit messy? About clearing the session every 500 iteration, it would still send data by pack of 100 queries. My perf problem is due to the connection time of the server (or time between two queries, i don't know how it is called); 60 000 queries make it too slow. Is the 100 batch-size limit due to NHibernate or to SQL Server (2000 in my case)? If it is not from nhibernate, then using ado.net wouldn't solve the problem, would it? Thank you for your previous answer, and I hope for another one :-). Nelson Cabral 2009/5/24 Fabio Maulo <[email protected]> > ah... and before think about NH perf you should think in doing the same > with pure ADO.NET. > > 2009/5/23 Fabio Maulo <[email protected]> > > for NH2.0.1:1) NH is not the right way to manage massive data manipulation >> 2) try statelesssession >> 3) if you want use statefull session close or clear it each 500 iteration >> (for example) >> 4) NH2.1.0 has executable HQL >> http://fabiomaulo.blogspot.com/2009/05/nhibernate-210-executable-queries.html >> >> 2009/5/22 Nelson <[email protected]> >> >> >>> Hi, >>> >>> My current application heavily relies on NHibernate 2.0.1. I currently >>> have a bottleneck, in which my application might insert around 6 000 >>> 000 entities (calculations in facts). I currently resolved the problem >>> by setting the adonet.bath_size property to 100. >>> >>> With a batch-size of 100, 36000 entities are inserted in 100 seconds. >>> As I am a great mathematician, I have deduced that inserting 6 000 000 >>> (6 millions!) entities might take up to 240 minutes (=4 hours). I >>> think it is due to the 6 000 000 / 100 = 60 000 queries (slow network >>> I guess). >>> >>> Supposing this is linear time problem, setting the batch size to 1000 >>> should divide this time by 10, and to 2000 should make a total time of >>> 12 minutes, which would be awesome. But, when setting the batch size >>> to 1000 I noticed that insert commands where batched by 100. >>> >>> My question is then : where does this limit comes from? I can't find >>> any answer on google. You are my last hope NHUSER GROUP!! >>> >>> Have a great weekend ! >>> >>> >>> >> >> >> -- >> Fabio Maulo >> > > > > -- > Fabio Maulo > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
