Hi, all. We get this exception on commit when saving an entity (Entity A). We've verified the session/transaction are still open so it's not a LazyInit that you get when the session is no longer available.
This is on 1.2GA w/ SQL2000. Every entity has a proxy defined (same class w/ virtuals pattern). Entity A has a many-to-one to B (cascade=none). B has parent-child relationship to self (think tree). i.e. B has many-to-one to B ("Parent", cascade=none) and has one-to-many to B ("Children", cascade=save-update, inverse=true, lazy=true).
We've been debugging through it and it looks like the null ref exception is occuring because CollectionEntry.LoadedPersister is null. I cannot figure out what I'm doing wrong to cause it though. Thanks in advance for any help.
Cheers,
~Mork
Here's a partial stack trace:
NHibernate.LazyInitializationException: Failed to lazily initialize a collection ----> System.NullReferenceException: Object reference not set to an instance of an object.
at NHibernate.Impl.SessionImpl.GetCollectionOwner(Object key, ICollectionPersister collectionPersister) in C:\Downloads\NHibernate\src\NHibernate\Impl\SessionImpl.cs:line 4508
at NHibernate.Impl.SessionImpl.GetCollectionOwner(CollectionEntry ce) in C:\Downloads\NHibernate\src\NHibernate\Impl\SessionImpl.cs:line 4502
at NHibernate.Impl.SessionImpl.InitializeCollection(IPersistentCollection collection, Boolean writing) in C:\Downloads\NHibernate\src\NHibernate\Impl\SessionImpl.cs:line 4484
at NHibernate.Collection.AbstractPersistentCollection.Initialize(Boolean writing) in C:\Downloads\NHibernate\src\NHibernate\Collection\AbstractPersistentCo...).
|