views:

399

answers:

1

I'm trying to set up NHibernate in Mono, to store objects in SQLite.

I've copied/pasted the example configuration file. I only have the following two lines of code:

var config = new Configuration();
config.Configure();

Which result in the following ungrammatical validation exception:

System.InvalidOperationException : Unexpected attempt to validation state transition from Finished to Content was happened.

I'm not sure what the problem is. If the problem is Mono specific, then I'd like to find a workaround.

EDIT:

This may or may not still be a problem, but I've switched to FluentNHibernate for configuration. Highly recommended.

+1  A: 

This Mono bug looks relevant - but it was fixed last September.

Which version of Mono are you using, and have you tried the most recent version?

In particular, I've just tried your test code on Mono 2.4 on Linux, and it worked fine.

Jon Skeet
I've seen that bug but I'm hit the issue with a mono build from svn trunk post 2.4 release. I will try this with 2.4 release if I get a chance this weekend, thanks for the heads up.
anthony
I've tried it with Mono 2.4 on both Linux and Windows and it's been fine. My test program really was *just* those two lines of code though. Oh, and this was using the latest release of NHibernate too - which version of NH are you using?
Jon Skeet
My test program was just those two lines as well, using NHibernate 2.0.1 GA.
anthony
Just tried it against 2.0.1GA on my Windows box with Mono 2.4, and that was fine. Sounds like it might be a regression post the 2.4 release. It's probably worth filing a Mono bug. Do you *need* a post-2.4 version?
Jon Skeet
I finally got around to trying this with mono 2.4.2.1 and I'm getting the same exception that I was getting with svn trunk.
anthony
Very weird. When I get a moment I'll try on 2.4.2.1.
Jon Skeet