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.

enter image description here

the nhibernate data mapping screenshots below.

parent table patref:

enter image description here

enter image description here

sub table patcon: enter image description here

enter image description here

the implement patrefmanagerprop.getbyid enter image description here

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

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - Bypass Geo Redirect for specific directories -

php - .htaccess mod_rewrite for dynamic url which has domain names -