-->
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.  [ 4 posts ] 
Author Message
 Post subject: refresh vs replicate
PostPosted: Wed Jun 08, 2005 8:29 am 
Beginner
Beginner

Joined: Tue Apr 05, 2005 12:09 pm
Posts: 48
Location: Slovakia (SK), Košice (KE)
hi

1. load object from database (session.load())
2. store object into HTTP session
3. next HTTP request (object becames detached)
4. Q: how to reattach the detached object (for reading)?
- session.update() doesn't have a sense (I don't want to update DB)
- session.refresh() works, but documentation says it should be used only if I use triggers etc ...
- session.replicate(parendObject, ReplicationMode.OVERWRITE); doesn't update children collection (i don't know why)
- or should I again load the object as in step 1 ?


pls tell me what is the clearest solution


subquestion:
What is the difference between session.refresh(object) and session.replicate(businessCase, ReplicationMode.OVERWRITE); ? Replicate doesn't update collection of children although I use cascade="all"; refresh does.


thanks


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 08, 2005 8:38 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Read Hibernate in Action.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 05, 2006 12:37 am 
Regular
Regular

Joined: Wed May 11, 2005 11:57 pm
Posts: 80
christian wrote:
Read Hibernate in Action.


I think the funniest thing about this extremely helpful response is that the replicate() method which the poster asked about did not exist at the time that HIA was written.

Seriously though, I own the book, I've read it, where's the answer?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 05, 2006 1:18 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Um. replicate() is not used for anything to do with what the original poster is trying to use it for.

From the contents of the post, it appears that the poster had no idea of basic Hibernate usage. The book will properly explain the use of lock(), update(), and many other things the poster needs to know about to use Hibernate successfully.

So the response was quite reasonable and helpful.


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