Hibernate Books

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: duplicate second level caching on queries
PostPosted: Sat Jul 07, 2007 4:06 am 
Newbie

Joined: Tue Feb 13, 2007 3:31 am
Posts: 8
Hello, I'm using hibernate 3. I have a question about using second level caching. Currently I use ehcache. I have noticed that my objects are being recached pretty often when there are no changes to them. After some debugging, I found that each time I run a read-only query, any objects that are returned in the query somehow get re-put into the second level cache.

For example, List<Teacher> getAllTeachers(), invoking this method would get all Teacher instances placed into the second level cache even if they are already cached before. Does anyone know why? My suspicion is that the query loaded objects are cached into a different cache region, thus causing the duplication. But I haven't been able to find any information on that. Please help!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

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.