-->
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: find() versus refresh()
PostPosted: Fri Apr 06, 2007 10:04 am 
Senior
Senior

Joined: Mon Jul 24, 2006 8:43 am
Posts: 160
Hi,
When should an application use find() and when should it use refresh(), In terms of SQL generated what's the difference or pro's con's?
Regards


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 11, 2007 6:25 pm 
Newbie

Joined: Wed Apr 11, 2007 5:54 pm
Posts: 4
refresh() will always go the the database while find() will not if the entity is already in the persistence context.

Use find() to get an instance of the entity, and refresh() afterwards to populate the instance with data from the database again if you think there may be newer changes.


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.