-->
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: When will Hibernate return stale data
PostPosted: Tue Mar 28, 2006 10:55 pm 
Newbie

Joined: Sun Mar 26, 2006 3:04 pm
Posts: 6
According to hibernate documentation.

>> Hibernate does guarantee that the Query.list(..) will never return stale data; nor will they return the wrong data.

by any chance does this mean that session.load() and session.refresh() will never return stale data?

Thank
DuKot


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 28, 2006 11:23 pm 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
Session.refresh won't return stale data, but load/get might, if some other app or session has made a change since the object was put into the current session's cache. It is of course guaranteed not to be stale if it's not already in the session cache, so if at any point it's essential that your next read not be stale, you can call session.clear() first. That will clear the cache and guarantee that subsequent reads won't return stale 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.