-->
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.  [ 3 posts ] 
Author Message
 Post subject: Resotre session in proxies of detached entity
PostPosted: Mon Feb 18, 2008 3:45 pm 
Newbie

Joined: Mon Feb 18, 2008 3:35 pm
Posts: 12
Location: Belarus
For restoring of proxies of unchanged object i can use Session.Lock, but only for UNCHANGED entities.


simple example:

Open Session1
MyEntity entity = Session1.Get<MyEntity>(id);
Close Session1

entity.Name = "I have chenged entity";
entity.Number += 4;

Open Session2
Session2.RestoreProxies(entity);//how to do this?
string name = entity.RefferencedEntity.Name;
Session1.SaveOrUpdate(entity);
Close Session2


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 19, 2008 12:30 am 
Expert
Expert

Joined: Fri May 13, 2005 11:13 am
Posts: 292
Location: Rochester, NY
Will Update() do what you need? ( http://www.hibernate.org/hib_docs/nhibe ... g-detached )


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 19, 2008 3:23 am 
Newbie

Joined: Mon Feb 18, 2008 3:35 pm
Posts: 12
Location: Belarus
No Update will save an entity to DB, but I need to do some modiffications with this and linked entities in my business tier before saving it.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.