-->
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.  [ 2 posts ] 
Author Message
 Post subject: Hibernate Query Caching
PostPosted: Thu Jun 16, 2005 4:49 pm 
Regular
Regular

Joined: Thu Apr 21, 2005 9:05 am
Posts: 50
Location: Boston, U.S
I am in the process of developing a POC for caching.

I understand the query cache is not advisable for tables involving
frequent updates and inserts.

In my Proof of Concept, I am doing the following steps.

1.Execuing the Query using Query Cache (Refer to the piece of code below)

2. Insert the data into table specified in the query

3. Execute the Query (Same as Step 1)

4. Execute the Query (Same as in Step 1)

The query cache gets cleared due to insert (Step 2) after that
no matter how may times i execute the query, it is not at all
getting cached.

But the same gets cached if there were no inserts.

Your thoughts and Suggestions are most welcome.

Hibernate version:
3.0.1
Mapping documents:
<property name="hibernate.cache.region_prefix">repl-</property>
<property name="hibernate.cache.use_second_level_cache">true</property>
<property name="hibernate.cache.use_structured_entries">true</property>
<property name="hibernate.cache.use_query_cache">true</property>
<property name="hibernate.cache.provider_class">com.starwood.valhalla.coherence.CoherenceCacheProvider</property>

Code between sessionFactory.openSession() and session.close():

Query qry = session.createQuery(" from xxxx res");
qry.setCacheable(true);
qry.setCacheRegion("ResourceQuery");
Iterator itr = qry.list().iterator();


Full stack trace of any exception that occurs:

Name and version of the database you are using:

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Top
 Profile  
 
 Post subject: Updated Cache Provider
PostPosted: Wed Jun 22, 2005 3:21 pm 
Newbie

Joined: Fri Jul 30, 2004 10:33 am
Posts: 3
I would suggest testing this with the recently updated CoherenceCacheProvider on the Hibernate Wiki (http://www.hibernate.org/132.html).

_________________
Rob Misek
Tangosol, Inc.


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