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: EHCache - how does it work?
PostPosted: Fri May 30, 2008 8:33 am 
Newbie

Joined: Mon Feb 04, 2008 6:31 am
Posts: 8
Hi,
I've got a question about ehcache - when I'm doing a query (like "from MyObject") how is the cache working? Is all the data fetched from the DB and then compared to the objects in cache (and then we've got a hit or miss) or are only the id's retrieved and then compared to the cached objects?
I've started wondering after changing manually in my db a record, and the data was retrieved correctly - how did Hibernate/EHCache noticed the change?
It's configured as a second level cache.

--
Regards,
Kornel


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 30, 2008 12:03 pm 
Expert
Expert

Joined: Fri Aug 19, 2005 2:11 pm
Posts: 628
Location: Cincinnati
the cache is cleared when a table update is called by your application. Problem is when you have mutliple applications or threads updating the same table.

_________________
Chris

If you were at work doing this voluntarily, imagine what you'd want to see to answer a question.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 02, 2008 5:47 am 
Newbie

Joined: Mon Feb 04, 2008 6:31 am
Posts: 8
kochcp wrote:
the cache is cleared when a table update is called by your application. Problem is when you have mutliple applications or threads updating the same table.


Fair enough, but I've changed the db manually (using a command line sql update statement). Coincidence (the object expired?) the listAll method returned the changed object not the old one?


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.