-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Move objects to another Session
PostPosted: Fri Feb 02, 2007 1:17 pm 
Newbie

Joined: Mon Oct 09, 2006 2:50 pm
Posts: 15
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


Last edited by rkania on Mon Feb 05, 2007 7:19 am, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 05, 2007 7:18 am 
Newbie

Joined: Mon Oct 09, 2006 2:50 pm
Posts: 15
Has nobody an idea?

It cannot be the solution, that I always have to unproxy the objects...


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.