-->
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: Composite key and caching
PostPosted: Fri May 09, 2008 10:38 am 
Newbie

Joined: Fri May 09, 2008 10:15 am
Posts: 2
Hibernate version: 3

Name and version of the database: Oracle 9i

I'm new to Hibernate and I want to understand more about the level 1 caching.

I have a table that represents courses taken by a person. The primary key is composite:

PERSON_ID String
COURSE_ID Integer

I thought I could read all rows from the table (and have them cached) and then do per-person queries from the cache like this:

"where PERSON_ID = ?"

However, the per-person queries seem to go to the database rather than the cache (from the Hibernate sql logging).

Is there a way to configure this so that Hibernate looks in the cache for the queries against part of the composite ID?

Thanks,
Steve


Top
 Profile  
 
 Post subject: Re: Composite key and caching
PostPosted: Fri May 09, 2008 10:51 am 
Newbie

Joined: Wed May 07, 2008 10:23 am
Posts: 9
Location: Santharavur,Chirala,AP,India
Hi

Please try this in applicationContext.xxml file..
<prop key="hibernate.use_query_cache">true</prop>

Thanks
PurnachandraRao.


sxturner wrote:
Hibernate version: 3

Name and version of the database: Oracle 9i

I'm new to Hibernate and I want to understand more about the level 1 caching.

I have a table that represents courses taken by a person. The primary key is composite:

PERSON_ID String
COURSE_ID Integer

I thought I could read all rows from the table (and have them cached) and then do per-person queries from the cache like this:

"where PERSON_ID = ?"

However, the per-person queries seem to go to the database rather than the cache (from the Hibernate sql logging).

Is there a way to configure this so that Hibernate looks in the cache for the queries against part of the composite ID?

Thanks,
Steve

_________________
B.PurnachandraRao
Santharavur,Chirala,AP,India


Top
 Profile  
 
 Post subject: Re: Composite key and caching
PostPosted: Fri May 09, 2008 1:03 pm 
Newbie

Joined: Fri May 09, 2008 10:15 am
Posts: 2
This doesn't have any effect - I still see the per-person queries hitting the database.

Steve

purnachandrarao wrote:
Hi

Please try this in applicationContext.xxml file..
<prop key="hibernate.use_query_cache">true</prop>

Thanks
PurnachandraRao.


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.