-->
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.  [ 1 post ] 
Author Message
 Post subject: how to detach objects from persistent context
PostPosted: Fri Mar 18, 2005 7:34 pm 
Beginner
Beginner

Joined: Thu Feb 03, 2005 7:23 pm
Posts: 23
Hello,

Once I get an object with session.get() how can I turn it into a detached object without closing the session?

I have gone over the API and found out about session.evict() but I am not sure.

Also, how can I associate the detached object later on with the session.

In summary this is what I need to do:

myobject = session.get(myobject.class, id)
// process my object
// detach my object
myobject = null;
// do some more processing
// recreate myobject
// attach myobject with session again
session.save(myobject)

Thanks,
-O.B.


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

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.