Dear all,
I have tried to created a test project to learn about the behavior of the Nibernate. However I have encoutered a problem. In the following, I will provide the relevant information about my programs and the error message.
Exception / Error message
Code:
Unix transport error.
in <0x0008f> Mono.Remoting.Channels.Unix.UnixMessageIO:ReceiveMessageStatus (System.IO.Stream networkStream, System.Byte[] buffer)
in <0x0017c> Mono.Remoting.Channels.Unix.UnixClientTransportSink:ProcessMessage (IMessage msg, ITransportHeaders requestHeaders, System.IO.Stream requestStream, ITransportHeaders responseHeaders, System.IO.Stream responseStream)
in <0x00252> Mono.Remoting.Channels.Unix.UnixBinaryClientFormatterSink:SyncProcessMessage (IMessage msg)
Software specificationKnoppix Linux 5.0.1
MonoDevelop 0.11
Mono 1.1.13.8,
MySQL 5.0.24
MySql.Data.dll (Connector.NET) had been included in the project reference.
Hibernate version: NHibernateContrib-1.0.2.0
ProjectsUsers: Library project, for database manipulation.
UsersTest: Testing project.
Mapping documents:Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
<class name="QuickStart.Users, Users" table="Users">
<!-- A 32 hex character is our surrogate key. It's automatically
generated by NHibernate with the increment function. -->
<id name="UserID" column="UserID" sql-type="int" not-null="true"/>
<generator class="increment" />
</id>
<property name="UserEmail" column="UserEmail" type="String" length="60" not-null="true" />
<property name="Username"column="Username" type="String" length="20" not-null="true" />
<property name="UserPassword" column="UserPassword" type="String" length="20" not-null="true" />
</class>
</hibernate-mapping>
app.config fileCode:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="hibernate-configuration"
type="NHibernate.Cfg.ConfigurationSectionHandler, NHibernate" />
</configSections>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.0">
<!-- an ISessionFactory instance -->
<session-factory name="Users">
<!-- properties -->
<property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
<property name="connection.driver_class">"NHibernate.Driver.MySqlDataDriver</property>
<property name="connection.connection_string">Server=localhost;Database=QuickStart;User ID=xxx;Password=xxx;CharSet=win1250</property>
<property name="show_sql">false</property>
<property name="dialect">NHibernate.Dialect.MySQLDialect</property>
<!-- mapping files -->
<mapping assembly="Users" />
</session-factory>
</hibernate-configuration>
</configuration>
Code between sessionFactory.openSession() and session.close():Code:
ITransaction transaction = session.BeginTransaction();
this.user = new Users(42, "ForPrefect@somewhere.com", "Ford Prefect", "NoPassword");
// Tell NHibernate that this object should be saved
session.Save(this.user);
// commit all of the changes to the DB and close the ISession
transaction.Commit();
Any help would be appreciate.
Regards,
FlnStar