nhibernate: uninitialized surrogate upheld save() cascade
i keep removing an nhibernate.persistentobjectexception job session.save() due an uninitialized surrogate upheld save(). i fiddle cascade settings i away, nonetheless following child objects aren't being saved.
the wholly repair i have found adding following defaultsaveeventlistener.
stable overrule bool reassociateifuninitializedproxy(object obj, global::nhibernate.engine.isessionimplementor source)
{
(!nhibernateutil.isinitialized(obj))
nhibernateutil.initialize(obj);
relapse base.reassociateifuninitializedproxy(obj, source);
}
this apparently an ideal solution.
any ideas?
Comments
Post a Comment