Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version: 1.2.0 GA
Mapping documents:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" >
<class name="PPEA.Donnees.Groupe, PPEA.Donnees" table="groupes">
<id name="ID" column="id" type="int" unsaved-value="0" >
<generator class="identity"/>
</id>
<property name="Nom" column="nom" type="String" length="255"/>
<property name="Description" column="description" type="String" length="510"/>
</class>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():
System.Console.WriteLine(" ==> Transaction ! ");
ITransaction transaction = session.BeginTransaction();
// -4-
System.Console.WriteLine(" ==> Creation du groupe ! ");
PPEA.Donnees.Groupe obj = new PPEA.Donnees.Groupe(" TEST !");
obj.Description = "Description";
// -5-
System.Console.WriteLine(" ==> Save ! ");
session.Save(obj);
// -6-
System.Console.WriteLine(" ==> Commit ! ");
transaction.Commit();
Full stack trace of any exception that occurs:
Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object
at NHibernate.Transaction.AdoTransaction.AfterTransactionCompletion (Boolean successful) [0x00000]
at NHibernate.Transaction.AdoTransaction.Commit () [0x00000]
at Apprendre.MainClass.NHibernate () [0x00098] in /donnees/Documents/Projets/MonoDevelop/Apprendre/Apprendre/Apprendre/Main.cs:89
at Apprendre.MainClass.Main (System.String[] args) [0x000d6] in /donnees/Documents/Projets/MonoDevelop/Apprendre/Apprendre/Apprendre/Main.cs:56
Name and version of the database you are using:
SQLite 3
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
Problems with Session and transaction handling?
Read this:
http://hibernate.org/42.html
Tous mes valeurs sont bien renseignées ... De plus la donnée est bien enregsitré ... ce qui est assez bizarre je trouve ...