NHibernate lazy properties behavior?

Posted by GeReV on Stack Overflow See other posts from Stack Overflow or by GeReV
Published on 2010-05-05T14:03:01Z Indexed on 2010/05/05 15:38 UTC
Read the original article Hit count: 160

Filed under:
|
|

I've been trying to get NHibernate into development for a project I'm working on at my workplace.

Since I have to put a strong emphasis on performance, I've been running a proof-of-concept stress test on an existing project's table with thousands of records, all of which contain a large text column.
However, when selecting a collection of these records, the select statement takes a relatively long time to execute; apparently due to the aforementioned column.

The first solution that comes to mind is setting this property as lazy:

<property name="Content" lazy="true"/>

But there seems to be no difference in the SQL generated by NHibernate. My question is, how do lazy properties behave in NHibernate? Is there some kind of type limitations I could be missing? Should I take a different approach altogether?

Using HQL's new Class(column1, column2) approach works, but lazy properties sounds like a simpler solution.

It's perhaps worth mentioning I'm using NHibernate 2.1.2GA with the Castle DynamicProxy.

Thanks!

© Stack Overflow or respective owner

Related posts about nhibernate

Related posts about .NET