-->
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: Cache collection of the top level object
PostPosted: Tue Aug 23, 2005 4:33 pm 
Beginner
Beginner

Joined: Tue Aug 23, 2005 3:52 pm
Posts: 26
Is it possible to create a collection cache of the top level object.
For example:
I have a top level object Cat that coincides with db table cat_tbl. I need to create a cached collection of Cats with certain predicate (cats of a certain bread). I want this collection to be updated when ever new cats objects are added or updated, and I want to access (get collection size, copy collection) collection without hitting the db.

Please help I am having difficultly understanding the what are the capabilities of the hibernate cache.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 23, 2005 5:04 pm 
Beginner
Beginner

Joined: Sun Jul 31, 2005 6:15 pm
Posts: 28
I' m just a newbie in hibernate, but I think that what u ask for is one of the main feature of hibernate.

As long as u stay in a session scope (ie between tx.begin and tx.commit) all change in the collection only occur in memory.

Maybe I misunderstood your question ?

Michael Courcy


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 23, 2005 5:31 pm 
Beginner
Beginner

Joined: Tue Aug 23, 2005 3:52 pm
Posts: 26
michaelcourcy wrote:
I' m just a newbie in hibernate, but I think that what u ask for is one of the main feature of hibernate.

As long as u stay in a session scope (ie between tx.begin and tx.commit) all change in the collection only occur in memory.

Maybe I misunderstood your question ?

Michael Courcy


I understand that. But consider this situation. Server is being hit with identical requests for data. If I set up a cache on the class level, data will be cached on the first request. However following request will still hit the db to retrieve indexes and then based on the index it will retrieve data from the cache.

Alternatively I can set up a query cache and cache results, but if some of the data changes query cache will be dropped and next request will hit the db again.

This is unacceptable for me. On each request I want to access latest cached data and return copy of the data to the client without hitting the db. I

I can’t figure out if hibernate is capable of this, if someone can shed some light on this please help.


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.