NHibernate version: 1.2Beta3
Hello,
I have a problem when I want to put an object from one session to another with ISession.SaveOrUpdateCopy(...) and one Property of this object is an uninitialized Proxy (INHibernateProxy-Impl).
With collections all is fine and when I unproxy the object in the property all is fine, too.
Here's some code:
Code:
MyObject obj = GetMyObjectFromAnywhere();
ISession sess = GetSessionFromSomeWhere();
obj.ProxPropertyObject = sess.Get(typeof(Anything), 1); //<-- returns the proxy
// sess.Close(); tried here, but problem is still there
ISession sessSave = GetSessionForSave();
sessSave.SaveOrUpdateCopy(obj); // <-- error "illegal atempt proxy.."
I'm using two sessions for those operations, because second (save-)session is closed imediately after called SaveOrUpdateCopy. And the first session is open until app ends (winapp). in this session there is the cache for my objects. (LazyLoading etc.).
Hope somebody can tell me, what I can do.
cu