-->
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.  [ 1 post ] 
Author Message
 Post subject: force HB to get all objects stored in 2nd level cache not DB
PostPosted: Sun Feb 17, 2008 11:45 pm 
Newbie

Joined: Fri Feb 15, 2008 4:24 am
Posts: 5
I work in a software product company, and we use hibernate in our java based application . The application is a smart-client based application where each client is itself a jvm . We were using our proprietary cache bor both client and server side now , but want to replace the server side cache with a cache solution that supports clustering.

Now we are trying to use ehcache as the hibernate second level cache and trying to know if we can replace our current cache with it . But some technical problems are coming up. The client tries to read our objects mainly based on its date fields which obviously is not a unique key . In our current in memory cache , we were maintaining a date list
to make the server side program know, which objects are there in the cache. eg. If client wants to read all objects with date as Feb 16 2008, the server side program checks if the date is included in the date list and if included, it simply loops through the object arraylist stored to filter out the needed objects. So database hit is avoided.

But, I think that in hibernate, if I query for objects with non-id field it anyway would search in the database (kindly do not consider the query level cache, but only the cache of persistent objects). Is there any way, to query the ehcache so that it only gives all the objects in the cache only , without going to database. i.e I want to force hibernate to look into the cache only , as I can make my objects stored in ehcache eternal, and know that if the datelist has the requested date, then I have all the objects
corresponding to it already in cache?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 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.