When troubleshooting query issues, one of the first things I will do is enable 'show_sql' or look at the logs, then I will execute this same statement through a query tool. If query analyzer or Toad cannot execute a query then it's not an NHibernate problem. You can even go the next step and execute the query in ADO.Net itself to prove your point but that is usually not necessary unless you are dealing with a more persistent individual.
Some common exceptions with large results or complex queries will be ADO throwing query timeout exceptions or maybe an out of memory exception. The first just means that the query took a long time to run, the fix for this could be optimizing your query or increasing the query timeout. The later may be fixed by narrowing your results or the columns you are selecting if the table has a lot of columns.
But neither of them are NHibernate's fault. More analysis and thought should be done before we just blame the first non-Microsoft product. NHibernate has a lot of features for those situations that when even good design fails, this is why it's the premier ORM for .Net.
No comments:
Post a Comment