Hi,
I keep getting an NHibernate.PersistentObjectException when calling session.Save() which is due to an uninitialized proxy passed to save(). If I fiddle with my cascade settings I can make it go away, but then child objects aren't being saved.
The only other fix I have found is by adding the following to my DefaultSaveEventListener.
protected override bool ReassociateIfUninitializedProxy(object obj, global::NHibernate.Engine.ISessionImplementor source)
{
if (!NHibernateUtil.IsInitialized(obj))
NHibernateUtil.Initialize(obj);
return base.ReassociateIfUninitializedProxy(obj, source);
}
This is obviously not an ideal solution.
Any ideas?