c# - Nhibernate exception: base {NHibernate.HibernateException} = {"illegal access to loading collection"} -
i working on nhibernate exception :"base {nhibernate.hibernateexception} = {"illegal access loading collection"}"
table patref parent table. table patcon sub table. when retrieve data patref patcons @ debuging mode, error message screen shot below.
the nhibernate data mapping screenshots below.
parent table patref:
sub table patcon:
the implement patrefmanagerprop.getbyid
anytime i've seen has been caused attempt access lazily loaded collection when isession
used retrieve object has been disposed or no longer exists.
you can fix attaching entity session using isession.lock(entity, lockmode.none)
.
just note of warning - can't attach transient entity session.
(great detail in original question way. +1 that)
Comments
Post a Comment