For an ASP.Net project I'm using (Fluent) NHibernate for the persistence and JQGrid for displaying the data in a table. But when I want to use the AutoComplete feature of JQGrid I get an System.ArgumentException: Column 'HibernateLazyInitializer' does not belong with this table.
while obtaining the data in an AJAX Request.
But this error occurs only sporadically and when some kind of proxyclass is used in the list. Therefore I think it has something to with the lazyloading of NHibernate.
protected new void Page_Load(object sender, EventArgs e)
{
base.Page_Load(sender, e);
_jqAutoComplete.DataSource = Session.CreateCriteria<Domain.Brand>()
.List<Domain.Brand>();
_jqAutoComplete.DataBind();
}
Usually the lazyloading is a pretty cool feature. Only in this case it leads to an error and therefore I don't want to disable it in the whole project. So, is there a way of modifying the CreateCriteria for not using LazyLoading but EagerLoading in this one case? Or is there something else I'm missing? If there is a good tutorial for understanding LazyLoading I would be glad too.