Hello !
I'm new to NHibernate anf I would like to learn ... So I'm reading the doc and I download the step-by-step exemple ...
But as I'm a not a Windows/SqlServer user I'm trying to make it work on Linux/Mono/Sqlite ... I'm fighting against small problems ... I've tried to read docs but now ...
Point 1 : Mono does not include Sqlite.Net but Mono.Data.SqliteClient ...
So after a small reading, I've seen that I've have to change the present Driver to make it point to Mono.Data.SqliteClient instead of Sqlite.Net ...
==> object not set to an instance of an object
Point 2 : Compile NHibernate with MonoDevelop
In fact, the problem is the that the ressource name is NHibernate.<RessourceName>. Compiling with MonoDevelop, the ressource Name is <RessouceName>. In order to make it work, I've put a test to check both ... First Ok, is used ...
Point 3 : Parameters ...
It seems that @ is not recognize by my Sqllite or Mono.Data.SqliteClient but : works better ...
Point 4 : A new object not set to an instance of an object ...
see the trace :-)
If somebody can help me !!!
Hibernate version: 1.1
Full stack trace of any exception that occurs:
Unhandled Exception: NHibernate.LazyInitializationException: Failed to lazily initialize a collection ---> NHibernate.HibernateException: Creating a proxy instance failed ---> System.NullReferenceException: Object reference not set to an instance of an object
in <0x00088> Castle.DynamicProxy.Builder.CodeBuilder.EasyType:IsAssemblySigned (System.Type baseType)
in <0x00032> Castle.DynamicProxy.Builder.CodeBuilder.EasyType:.ctor (Castle.DynamicProxy.Builder.CodeGenerators.ModuleScope modulescope, System.String name, System.Type baseType, System.Type[] interfaces, Boolean serializable)
in <0x0003e> Castle.DynamicProxy.Builder.CodeGenerators.BaseCodeGenerator:CreateTypeBuilder (System.String typeName, System.Type baseType, System.Type[] interfaces)
in <0x000e6> Castle.DynamicProxy.Builder.CodeGenerators.ClassProxyGenerator:GenerateCode (System.Type baseClass, System.Type[] interfaces)
in <0x00033> Castle.DynamicProxy.Builder.DefaultProxyBuilder:CreateClassProxy (System.Type theClass, System.Type[] interfaces)
in <0x00061> Castle.DynamicProxy.ProxyGenerator:CreateClassProxy (System.Type baseClass, System.Type[] interfaces, IInterceptor interceptor, Boolean checkAbstract, System.Object[] argumentsForConstructor)
in [0x00040] (at [HOME]/NHibernate/src/NHibernate/Proxy/CastleProxyFactory.cs:59) NHibernate.Proxy.CastleProxyFactory:GetProxy (System.Object id, ISessionImplementor session)--- End of inner exception stack trace ---
in [0x00096] (at [HOME]/NHibernate/src/NHibernate/Proxy/CastleProxyFactory.cs:72) NHibernate.Proxy.CastleProxyFactory:GetProxy (System.Object id, ISessionImplementor session)
in [0x00008] (at [HOME]/NHibernate/src/NHibernate/Persister/AbstractEntityPersister.cs:1496) NHibernate.Persister.AbstractEntityPersister:CreateProxy (System.Object id, ISessionImplementor session)
in [0x000a3] (at [HOME]/NHibernate/src/NHibernate/Impl/SessionImpl.cs:2407) NHibernate.Impl.SessionImpl:DoLoadByClass (System.Type clazz, System.Object id, Boolean checkDeleted, Boolean allowProxyCreation)
in [0x00005] (at [HOME]/NHibernate/src/NHibernate/Impl/SessionImpl.cs:2319) NHibernate.Impl.SessionImpl:InternalLoad (System.Type clazz, System.Object id)
in [0x00008] (at [HOME]/NHibernate/src/NHibernate/Type/ManyToOneType.cs:90) NHibernate.Type.ManyToOneType:ResolveIdentifier (System.Object id, ISessionImplementor session)
in [0x00016] (at [HOME]/NHibernate/src/NHibernate/Type/EntityType.cs:277) NHibernate.Type.EntityType:ResolveIdentifier (System.Object id, ISessionImplementor session, System.Object owner)
in [0x0000f] (at [HOME]/NHibernate/src/NHibernate/Type/EntityType.cs:177) NHibernate.Type.EntityType:NullSafeGet (IDataReader rs, System.String[] names, ISessionImplementor session, System.Object owner)
in [0x0000f] (at [HOME]/NHibernate/src/NHibernate/Collection/AbstractCollectionPersister.cs:397) NHibernate.Collection.AbstractCollectionPersister:ReadElement (IDataReader rs, System.Object owner, ISessionImplementor session)
in [0x00009] (at [HOME]/NHibernate/src/NHibernate/Collection/Set.cs:432) NHibernate.Collection.Set:ReadFrom (IDataReader rs, ICollectionPersister persister, System.Object owner)
in [0x0006f] (at [HOME]/NHibernate/src/NHibernate/Loader/Loader.cs:467) NHibernate.Loader.Loader:ReadCollectionElement (System.Object optionalOwner, System.Object optionalKey, IDataReader rs, ISessionImplementor session)
in [0x00150] (at [HOME]/NHibernate/src/NHibernate/Loader/Loader.cs:282) NHibernate.Loader.Loader:GetRowFromResultSet (IDataReader resultSet, ISessionImplementor session, NHibernate.Engine.QueryParameters queryParameters, IList hydratedObjects, System.Object optionalObject, System.Object optionalId, NHibernate.Engine.Key[] keys, Boolean returnProxies)
in [0x000cc] (at [HOME]/NHibernate/src/NHibernate/Loader/Loader.cs:337) NHibernate.Loader.Loader:DoQuery (ISessionImplementor session, NHibernate.Engine.QueryParameters queryParameters, System.Object optionalObject, System.Object optionalId, System.Object[] optionalCollectionKeys, Boolean returnProxies)--- End of inner exception stack trace ---
in [0x0006a] (at [HOME]/NHibernate/src/NHibernate/Collection/PersistentCollection.cs:263) NHibernate.Collection.PersistentCollection:Initialize (Boolean writing)
in [0x00002] (at [HOME]/NHibernate/src/NHibernate/Collection/PersistentCollection.cs:78) NHibernate.Collection.PersistentCollection:Read ()
in [0x00001] (at [HOME]/NHibernate/src/NHibernate/Collection/Set.cs:368) NHibernate.Collection.Set:GetEnumerator ()
in [0x000ae] (at [HOME]/NHibernate_Exemple/SourceCode/OrderSystem/OrderSystem.UI/CrudSamples.cs:53) OrderSystem.UI.CrudSamples:ListSupplierProductsAndManufacturers (Int32 supplierId)
in [0x00019] (at [HOME]/NHibernate_Exemple/SourceCode/OrderSystem/OrderSystem.UI/Program.cs:25) OrderSystem.UI.Program:Main ()
Name and version of the database you are using: Sqlite 3
|