use class = "hilo":
<generator class="hilo">
Example:
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="NHibernate__MyClass" assembly="NHibernate__MyClass"> <class name="MyClass" table="MyClass"> <id name="Id" type="int" column="ID"> <generator class="hilo"> </id> <property name="Name"> <column name="Name" not-null="true" /> </property> <property name="Value"> <column name="Value" not-null="true" /> </property> </class> </hibernate-mapping>
I am simplified:
<id name="Id"> <column name="ID" sql-type="int" not-null="true"/> <generator class="hilo" /> </id>
in
<id name="Id" type="int" column="ID"> <generator class="hilo"> </id>
You may have some syntax error that confuses NHibernate.
If you can provide more detailed information about the code that runs before the crash, or something else that may seem important to you, this can speed up the speed at which your problem is resolved.
Mark rogers
source share