I’m building a solution where I’m retrieving large amounts of data from the database(5k to 10k records). Our existing data access layer uses Fluent NHibernate but I’m “scared” that I will incur a large amount of overhead by hydrating object models that represent the database entities.
Can I retrieve simply an ADO dataset?
Yes you should be concerned about the performance of this. You can look at using the IStatelessSession functionality of NHibernate. However this probably won’t give you the performance you are looking for. While I haven’t used NH since 2.1.2GA, I would find it unlikely that they’ve substantially improved the performance of NH when it comes to bulk operations. To put it bluntly, NH just sucks (and most ORMs in general for that matter) when it comes to bulk operations.
Q: Can I retrieve simply an ADO dataset?
Of course you can. Just because you’re using NHibernate doesn’t mean you can’t new up an ADO.NET connection and hit the database in the raw.
As much as I loathe data tables and data sets, this one of the rare cases you might want to consider using them instead of adding the overhead of mapping / creating the objects associated with your 10K rows of data.