-->
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: How to clear hibernate cache
PostPosted: Fri Dec 05, 2008 12:26 am 
Regular
Regular

Joined: Wed Oct 15, 2008 6:59 am
Posts: 103
Location: Chennai
Hi Friends!
My problem as follows.,
In my project, we had the form used to display and edit user profile information. When users edit the form the values are updated to the database then i have to display the updated info on the form.
when i retrieve the updated value from DB through HQL, it retrieves only old data. But the DB has updated values..

we are using hibernate3.1 and mysql5.
i don't enable hibernate caching in hibernate.cfg.xml file.

i already tried session.evict and sessionFactory.evict methods. but no use, till now it retrieve only old values...


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 09, 2008 5:20 pm 
Newbie

Joined: Tue Dec 09, 2008 4:56 pm
Posts: 6
If you're updating using hibernate, then you should already have the updated record.

For example, calling recordObject.saveOrUpdate() will result in recordOjbect having the data of the updated record. You won't need to make a trip to the db to get the latest recordObject data.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 09, 2008 5:22 pm 
Newbie

Joined: Tue Dec 09, 2008 4:56 pm
Posts: 6
Also, you may need to invalidate the user cache.


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.