Hi,
currently i`m working with NHibernate 1.2 and with a MySQl Database 5.
My mapping for an entity called Host is
Code:
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="UtilSQL.Host, UtilSQL" table="host">
<id name="Id">
<generator class="identity"/>
</id>
<property name="HostName" unique="true" not-null="true" column="HostName" type="String" length="255" />
</class>
</hibernate-mapping>
and i`m opening the connection as follows:
Code:
NHibernate.Cfg.Configuration hibConfig = new NHibernate.Cfg.Configuration();
hibConfig.SetProperty("hibernate.show_sql", "true");
hibConfig.SetProperty("hibernate.dialect", NHibernate.Dialect.MySQLDialect");
hibConfig.SetProperty("hibernate.connection.provider", "NHibernate.Connection.DriverConnectionProvider");
hibConfig.SetProperty("hibernate.connection.connection_string", "Server=localhost;Database=test;User ID=root;Password=;CharSet=utf8");
Now i try to insert a new Host to my database and
force a rollback of a transaction for testing purpose. I`m doing this with the following code
Code:
ITransaction trans = myHibernateSession.BeginTransaction();
Host h = new Host("testHostName");
myHibernateSession.Save(h);
trans.Rollback();
Normally i expect that there is no entry generated in the database but it is!
So whats wrong here?
If you need any more information let me know.
Thx t2x