[ http://jira.nhibernate.org/browse/NH-719?page=comments#action_14273 ]
Sergey Koshcheyev commented on NH-719:
--------------------------------------
Actually, H3.2 changed the implementation recently to avoid initializing the proxy, so I'm going to follow them.
> Caching of "any" reference to lazy classes
> ------------------------------------------
>
> Key: NH-719
> URL: http://jira.nhibernate.org/browse/NH-719
> Project: NHibernate
> Type: Bug
> Components: Core
> Versions: 1.0.2, 1.2.0.Alpha1
> Reporter: Cris Constantin
> Fix For: 1.0.3, 1.2.0.Beta1
> Attachments: NH719.patch, NH719.zip
>
> Consider these the mappings:
> <class name="C" lazy="false">
> <any name="Owner" id-type="Int32" meta-type="Char">
> <meta-value value="b" class="A"/>
> <meta-value value="a" class="B"/>
> <column name="OwnerType"/>
> <column name="OwnerID"/>
> </any>
> ....
> </class>
> <class name="A" lazy="true"/>
> <class name="B" lazy="true"/>
> With all classes A, B, and C being cached.
> The stack trace while trying to load an object of class C from the cache
> ERROR NHibernate.Proxy.LazyInitializer [(null)] - Exception initializing proxy [C#1]
> NHibernate.MappingException: Unknown entity class: CProxyTypeA_INHibernateProxy1
> at NHibernate.Impl.SessionFactoryImpl.GetPersister(Type theClass)
> at NHibernate.Impl.SessionImpl.GetClassPersister(Type theClass)
> at NHibernate.Impl.SessionImpl.DoLoadByClass(Type clazz, Object id, Boolean checkDeleted, Boolean allowProxyCreation)
> at NHibernate.Impl.SessionImpl.Load(Type clazz, Object id)
> at NHibernate.Type.ObjectType.Assemble(Object cached, ISessionImplementor session, Object owner)
> at NHibernate.Impl.CacheEntry.Assemble(Object[] values, Object result, Object id, IClassPersister persister, IInterceptor interceptor, ISessionImplementor session)
> at NHibernate.Impl.CacheEntry.Assemble(Object instance, Object id, IClassPersister persister, IInterceptor interceptor, ISessionImplementor session)
> at NHibernate.Impl.SessionImpl.AssembleCacheEntry(CacheEntry entry, Object id, IClassPersister persister, Object optionalObject)
> at NHibernate.Impl.SessionImpl.DoLoad(Type theClass, Object id, Object optionalObject, LockMode lockMode, Boolean checkDeleted)
> at NHibernate.Impl.SessionImpl.ImmediateLoad(Type clazz, Object id)
> at NHibernate.Proxy.LazyInitializer.Initialize()
> at NHibernate.Proxy.LazyInitializer.InitializeWrapExceptions()
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.nhibernate.org/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
|