-->
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: caching queries
PostPosted: Mon May 08, 2006 12:59 pm 
Newbie

Joined: Mon May 08, 2006 12:47 pm
Posts: 6
Hi everyone,

i have several problems with some queries, i have two tables Person (id, idCountry) where primary key is a composite id of id and idCountry, my other table is Country(idCountry, CountryName), if i search all persons who has visited USA i received a set of persons, well , now i need to get the persons in that set that visited Mexico too, then i received a small set of persons, now i need in that set the persons that also visited spain, how can i use caching feature for this?...

thanks...


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 08, 2006 1:36 pm 
Expert
Expert

Joined: Fri May 13, 2005 5:56 pm
Posts: 308
Location: Santa Barbara, California, USA
I'm assuming you are asking about caching the objects and not the query. I don't think caching the query will have any benefit here. However, for caching the objects that are retrieved by the query...

If you are doing this query within a single session, the resultset will be cached in the first-level cache by default and you don't need to do anything. If you are doing this across multiple sessions (as in a Web client), you will need to enable second-level caching appropriately.

I would recommend that you turn on DEBUG in NH logging and watch to see if your "sub" results are being retrieved from cache or from the DB. If so, enable second-level cache and then try again.

-devon


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.