Problem with the NHibernate example of ProjectTracker

Problem with the NHibernate example of ProjectTracker

Old forum URL: forums.lhotka.net/forums/t/3008.aspx


skaue posted on Friday, June 08, 2007

We are having problems getting the NHibernate example to run on the latest version of NHibernate (1.2x). Is the example on CSLAContrib incompatible with NHibernate 1.2?

Another question to David; what is the prupose of the code in Interfaces namespace (foldername Interfaces)?

skaue replied on Friday, June 08, 2007

Oh well, apparantly the code was all good, but the UI-project didnt include Nullables and Nullables.NHibernate as reference, and hence the listing of data in the web UI failed. Now it works!

And without the Interface thingy from the example (which I dont understand what is for).

DavidDilworth replied on Monday, July 30, 2007

Just seen this post after a period away from the forums.

Glad to know you managed to get it working.

You can ignore the Interfaces folder, that has crept into the solution by mistake and was a hangover from some research work we were doing.

David

harmar replied on Sunday, August 26, 2007

i'm just curious how you got the project to run. i capitulated after all these errors regarding to all the non-virtual methods required because of the now default lazy loading. all i could find about handling this was this section in the nhibernate 1.2 migration guide:

Existing applications will need to explicitly specify lazy="false" on all non-lazy class and collection mappings. For the lazy classes to function correctly, all their public members must be virtual (overridable). Since this is a very significant potential source of errors when developing on .NET, NHibernate 1.2 will check at configuration time that all lazy classes fulfill the requirements. [...]
Beware, this means you have to put lazy="false" on all collection mappings and classes which previously did not have a "lazy"-attribute.
A quick and dirty alternative for migration is also to put default-lazy="false" on all your hibernate-mapping elements.

how did you do it? changed all the non-virtual methods in the base classes too?
is the support for generic collections worth this troubles?

btw: i really want to thank david for this wonderful and inspiring contribution!

harry

DavidDilworth replied on Tuesday, August 28, 2007

Just to be clear for other readers of these posts - the example code in CodePlex was written against NHibernate v1.0.3.

We have not upgraded yet to the latest v1.2 code line due to project delivery work.

 

Copyright (c) Marimer LLC