-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: proxy, lazy and mono
PostPosted: Mon Feb 20, 2006 4:52 pm 
Newbie

Joined: Mon Feb 20, 2006 4:28 pm
Posts: 1
Hello,

I'm testing nhibernate with mono and I have problems when I turn lazy="true".

If I define an interface for proxy lazy recuperation runs ok, but, if I define public members as virtual, and don't define proxy interface, then hibernate crash in a many-to-one relation with this error:

-------------------------------------------------------------------------------
Unhandled Exception: 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 <0x00085> NHibernate.Proxy.CastleProxyFactory:GetProxy (System.Object id, ISessionImplementor session)--- End of inner exception stack trace ---

in <0x001e3> NHibernate.Proxy.CastleProxyFactory:GetProxy (System.Object id, ISessionImplementor session)
in <0x00020> NHibernate.Persister.AbstractEntityPersister:CreateProxy (System.Object id, ISessionImplementor session)
in <0x001a0> NHibernate.Impl.SessionImpl:DoLoadByClass (System.Type clazz, System.Object id, Boolean checkDeleted, Boolean allowProxyCreation)
in <0x0001a> NHibernate.Impl.SessionImpl:InternalLoad (System.Type clazz, System.Object id)
in <0x00032> NHibernate.Type.ManyToOneType:ResolveIdentifier (System.Object id, ISessionImplementor session)
in <0x00030> NHibernate.Type.EntityType:ResolveIdentifier (System.Object id, ISessionImplementor session, System.Object owner)
in <0x0011b> NHibernate.Impl.SessionImpl:InitializeEntity (System.Object obj)
in <0x000c0> NHibernate.Loader.Loader:InitializeEntitiesAndCollections (IList hydratedObjects, System.Object resultSetId, ISessionImplementor session)
in <0x00316> NHibernate.Loader.Loader:DoQuery (ISessionImplementor session, NHibernate.Engine.QueryParameters queryParameters, System.Object optionalObject, System.Object optionalId, System.Object[] optionalCollectionKeys, Boolean returnProxies)
in <0x0003a> NHibernate.Loader.Loader:DoQueryAndInitializeNonLazyCollections (ISessionImplementor session, NHibernate.Engine.QueryParameters queryParameters, System.Object optionalObject, System.Object optionalId, System.Object[] optionalCollectionKeys, Boolean returnProxies)
in <0x0003d> NHibernate.Loader.Loader:LoadEntity (ISessionImplementor session, System.Object[] values, NHibernate.Type.IType[] types, System.Object optionalObject, System.Object optionalID)
in <0x0007e> NHibernate.Loader.Loader:LoadEntity (ISessionImplementor session, System.Object id, IType identifierType, System.Object optionalObject, System.Object optionalIdentifier)
in <0x00028> NHibernate.Loader.EntityLoader:Load (ISessionImplementor session, System.Object id, System.Object optionalObject, System.Object optionalId)
in <0x00019> NHibernate.Loader.EntityLoader:Load (ISessionImplementor session, System.Object id, System.Object optionalObject)
in <0x00197> NHibernate.Persister.EntityPersister:Load (System.Object id, System.Object optionalObject, NHibernate.LockMode lockMode, ISessionImplementor session)
-------------------------------------------------------------------------------
Mono: 1.1.13.2
NHibernate: 1.0.2
Database: PostgreSQL 8.1

In the other hand, with MS .NET, for the same project, lazy recuperation works fine in all situations.

Some idea?, the problem is mono?

Thanks in advance,


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 21, 2006 5:20 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
This looks like a bug in Castle DynamicProxy, I reported it to the Castle mailing list. If they tell me anything I'll post it here.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 23, 2006 8:30 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
Please contact me via e-mail, I have a fixed version of DynamicProxy that I would like you to test.

Or you can build it yourself if you check out the DynamicProxy code from the Castle SVN repository.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.